aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/dal_doc_str.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-05-26 12:54:18 -0400
committerRalph Amissah <ralph@amissah.com>2010-05-26 12:54:18 -0400
commita2130055009ddc805a6c2f31309868e75d5fe9b7 (patch)
treeb863aa33775597b5fe19a05fa368bc012a34d9f3 /lib/sisu/v2/dal_doc_str.rb
parentvim syntax highlighter, added tag for internal document link to tagged point (diff)
dal (syntax, doc_str, numbering) add internal document link to tagged point
(including ocn)
Diffstat (limited to 'lib/sisu/v2/dal_doc_str.rb')
-rw-r--r--lib/sisu/v2/dal_doc_str.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index a250175b..e35baf5a 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -98,7 +98,7 @@ module SiSU_document_structure_extract
def endnote_test?(str)
bool=((str=~/~\{.+?\}~|~\[.+?\]~/) ? true : false)
end
- def extract_tags(str)
+ def extract_tags(str,nametag=nil)
tags=[]
if str.nil?
else
@@ -109,6 +109,7 @@ module SiSU_document_structure_extract
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?
end
+ tags=nametag ? (tags << nametag) : tags
end
[str,tags]
end
@@ -164,7 +165,7 @@ module SiSU_document_structure_extract
elsif t_o=~/^:?[A-C1-6]\~(\S+)\s+(.+)/
name,obj=$1,$2
note=endnote_test?(obj)
- obj,tags=extract_tags(obj)
+ obj,tags=extract_tags(obj,name)
h={:lv=>lv,:name=>name,:obj=>obj,:idx=>idx,:tags=>tags}
SiSU_document_structure::Object_heading.new.heading(h)
else nil