From a7dc41fdb5c4fc69ca2189412e9ba47ddf9aa084 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 00:36:10 -0500 Subject: v5 v6: ao, set document tags --- lib/sisu/v5/ao_doc_str.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sisu/v5/ao_doc_str.rb') 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 -- cgit v1.2.3