whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: ensure <br> is treated as a separator when extracting the combined text
Date Mon, 01 May 2017 17:38:48 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  c17a26b   ensure <br> is treated as a separator when extracting the combined
text
c17a26b is described below

commit c17a26b9157715847b049564a56fd0591babafb1
Author: Sebb <sebb@apache.org>
AuthorDate: Mon May 1 18:27:43 2017 +0100

    ensure <br> is treated as a separator when extracting the combined text
---
 tools/site-scan.rb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index 176f015..55d3ec0 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -114,10 +114,13 @@ def getText(txt, node)
   parent = nil # debug to show where parent needed to be fetched
   if not txt =~ /Apache Software Foundation/i # have we got all the text?
     if node.parent.name == 'a' # e.g. whimsical. such parents don't have extra text.
-      txt = squash(node.parent.parent.text)
+      newnode = node.parent.parent
     else
-      txt = squash(node.parent.text)
+      newnode = node.parent
     end
+    # ensure <br> is treated as a separator when extracting the combined text
+    newnode.css('br').each{ |br| br.replace(" ") }
+    txt = squash(newnode.text)
     parent = true
   end
   return txt, parent

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message