diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/dal_doc_str.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb index 46ae8d3c..a250175b 100644 --- a/lib/sisu/v2/dal_doc_str.rb +++ b/lib/sisu/v2/dal_doc_str.rb @@ -102,9 +102,9 @@ module SiSU_document_structure_extract tags=[] if str.nil? else - if str =~/(?:^|[ ])\*~([a-z0-9._-]+)(?:[ ]|$)/ - str.gsub!(/(^|[ ])\*~([a-z0-9._-]+)([ ]|$)/i, - "\\1#{Mx[:tag_o]}\\2#{Mx[:tag_c]}\\3") + if str =~/(?:^|[ ])\*~([a-z0-9._-]+)(?=[ #{Mx[:br_nl]}]|$)/ + str.gsub!(/(^|[ ])\*~([a-z0-9._-]+)(?=[ #{Mx[:br_nl]}]|$)/i, + "\\1#{Mx[:tag_o]}\\2#{Mx[:tag_c]}") str.gsub!(/ [ ]+/i,' ') tags=str.scan(/#{Mx[:tag_o]}(\S+?)#{Mx[:tag_c]}/).flatten str.gsub!(/[ ]?#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}[ ]?/,' ') #may be issues with spaces would leave one, but "code" blocks? |