community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864293 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js
Date Sat, 03 Aug 2019 03:12:55 GMT
Author: humbedooh
Date: Sat Aug  3 03:12:55 2019
New Revision: 1864293

URL: http://svn.apache.org/viewvc?rev=1864293&view=rev
Log:
tweak for cases where newline isn't the last character

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864293&r1=1864292&r2=1864293&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Aug  3 03:12:55
2019
@@ -258,8 +258,8 @@ function reflow(txt, chars) {
     if (x > chars) {
         output += (x == 0 ? "" : "\n") + word;
         x = word.length;
-    } else if (word[word.length-1] == '\n') {
-      x = 0;
+    } else if (word.indexOf('\n') != -1) {
+      x = word.length - word.indexOf('\n') - 1;
       output += word;
     } else {
       output += word;

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864293&r1=1864292&r2=1864293&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sat Aug  3 03:12:55 2019
@@ -1427,8 +1427,8 @@ function reflow(txt, chars) {
     if (x > chars) {
         output += (x == 0 ? "" : "\n") + word;
         x = word.length;
-    } else if (word[word.length-1] == '\n') {
-      x = 0;
+    } else if (word.indexOf('\n') != -1) {
+      x = word.length - word.indexOf('\n') - 1;
       output += word;
     } else {
       output += word;



Mime
View raw message