You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2019/08/03 03:12:55 UTC

svn commit: r1864293 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js

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;