Mercurial > octave-antonio
diff scripts/help/__strip_html_tags__.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children |
line wrap: on
line diff
--- a/scripts/help/__strip_html_tags__.m Thu Jan 20 17:24:59 2011 -0500 +++ b/scripts/help/__strip_html_tags__.m Thu Jan 20 17:35:29 2011 -0500 @@ -22,7 +22,7 @@ ## @end deftypefn ## Remove HTML tags from text. This is used as a simple HTML-to-text -## function. +## function. function [text, status] = __strip_html_tags__ (html_text) start = find (html_text == "<"); @@ -62,12 +62,12 @@ if (groups (1, 1) == 1) keep (1:groups (1, 2)) = false; endif - + ## Remove end-lines from the end if (sum (groups (end, :)) - 1 == length (text)) keep (groups (end, 1):end) = false; endif - + ## Remove groups of end-lines with more than 3 end-lines next to each other idx = find (groups (:, 2) >= 3); for k = 1:length (idx) @@ -75,7 +75,7 @@ stop = start + groups (idx (k), 2) - 1; keep (start+2:stop) = false; endfor - + ## Actually remove the elements text = text (keep); endfunction