diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-02-05 00:36:10 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-02-05 00:36:10 -0500 |
commit | a7dc41fdb5c4fc69ca2189412e9ba47ddf9aa084 (patch) | |
tree | 0f20f40bec5dd80af5830dbbdc70978734d30aa5 /lib/sisu/v5/ao_doc_str.rb | |
parent | v5 v6: epub, odt, check availability of zip program (diff) |
v5 v6: ao, set document tags
Diffstat (limited to 'lib/sisu/v5/ao_doc_str.rb')
-rw-r--r-- | lib/sisu/v5/ao_doc_str.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb index f7168c26..dd7f32f3 100644 --- a/lib/sisu/v5/ao_doc_str.rb +++ b/lib/sisu/v5/ao_doc_str.rb @@ -163,10 +163,13 @@ module SiSU_AO_DocumentStructureExtract str=str.gsub(/(^|[ ])\*~([a-z0-9._-]+)(?=[ #{Mx[:br_nl]}]|$)/i, "\\1#{Mx[:tag_o]}\\2#{Mx[:tag_c]}"). gsub(/ [ ]+/i,' ') - tags=str.scan(/#{Mx[:tag_o]}(\S+?)#{Mx[:tag_c]}/).flatten + tags=str.scan(/#{Mx[:tag_o]}(\S+?)#{Mx[:tag_c]}/).flatten.uniq str=str.gsub(/[ ]?#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}[ ]?/,' ') #may be issues with spaces would leave one, but "code" blocks? end tags=nametag ? (tags << nametag) : tags + tags.each do |t| + t.gsub!(/[^a-z0-9._-]/,'') + end end [str,tags] end |