From 10d0d040b11f17e7de7498e85f0c28a698ccc663 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 9 Jul 2019 15:17:01 -0400 Subject: xmls, special footnotes? minor step --- org/default_regex.org | 1 + org/output_xmls.org | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'org') diff --git a/org/default_regex.org b/org/default_regex.org index 5ddde3f..08fa141 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -521,6 +521,7 @@ static inline_notes_al_regular = ctRegex!(`【(.+?)】`, static inline_notes_al_gen_text = ctRegex!(`【(?P.+?)】`, "m"); static inline_notes_al_gen_ref = ctRegex!(`【(?P[*+]\s+)\s*(?P.+?)】`, "mg"); static inline_notes_al_regular_number_note = ctRegex!(`【(?P\d+)\s+(?P.+?)\s*】`, "mg"); +static inline_notes_al_special_char_note = ctRegex!(`【(?P(?:[*]|[+])+)\s+(?P.+?)】`, "mg"); static inline_al_delimiter_open_regular = ctRegex!(`【\s`, "m"); static inline_al_delimiter_open_symbol_star = ctRegex!(`【[*]\s`, "m"); static inline_al_delimiter_open_symbol_plus = ctRegex!(`【[+]\s`, "m"); diff --git a/org/output_xmls.org b/org/output_xmls.org index 0777b21..e994647 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -573,6 +573,13 @@ string inline_notes_scroll(O,M)( (" $1 ") ); } + if (obj.has.inline_notes_star) { + _txt = font_face(_txt); + _txt = _txt.replaceAll( + rgx.inline_notes_al_special_char_note, + (" $1 ") + ); + } debug(markup_endnotes) { if (_txt.match(rgx.inline_notes_al_regular_number_note)) { writeln(__LINE__, " (missed) markup endnote: ", obj.metainfo.is_a, ": ", obj.text); @@ -597,6 +604,30 @@ auto inline_notes_seg(O,M)( M doc_matters, ) { string[] _endnotes; + if (obj.has.inline_notes_star) { + _txt = font_face(_txt); + /+ need markup for text, and separated footnote +/ + foreach(m; _txt.matchAll(rgx.inline_notes_al_special_char_note)) { + _endnotes ~= format( + "%s%s%s%s\n %s%s%s%s%s\n %s\n%s", + "

", + "", + " ", + m.captures[1], + ".", + m.captures[2], + "

" + ); + } + _txt = _txt.replaceAll( + rgx.inline_notes_al_special_char_note, + (" $1 ") + ); + } if (obj.has.inline_notes_reg) { _txt = font_face(_txt); /+ need markup for text, and separated footnote +/ -- cgit v1.2.3