From 297410fc013135e992842b8347c2e0bbec042d20 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 3 Oct 2025 12:15:42 -0400 Subject: a text output (and skel an outline) - spine --text [--output=output path] [markup source] --- org/default_regex.org | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'org/default_regex.org') diff --git a/org/default_regex.org b/org/default_regex.org index 9a0ded7..fb2b993 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -308,9 +308,9 @@ static table_col_separator_nl = ctRegex!(`[┊]$`, "mg"); #+BEGIN_SRC d /+ inline markup footnotes endnotes +/ static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m"); -static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\}~`, "mg"); -static inline_notes_curly_sp_asterisk = ctRegex!(`~\{[*]+\s+(.+?)\}~`, "m"); -static inline_notes_curly_sp_plus = ctRegex!(`~\{[+]+\s+(.+?)\}~`, "m"); +static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\s*\}~`, "mg"); +static inline_notes_curly_sp_asterisk = ctRegex!(`~\{[*]+\s+(.+?)\s*\}~`, "m"); +static inline_notes_curly_sp_plus = ctRegex!(`~\{[+]+\s+(.+?)\s*\}~`, "m"); static note_ref = ctRegex!(`^\S+?noteref_(?P[0-9]+)`, "mg"); // {^{73.}^}#noteref_73 #+END_SRC @@ -331,8 +331,8 @@ static smid_inline_url_generic = ctRegex!(`(?:^|[}(\[ ])( static smid_inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); static smid_inline_link_naked_url = ctRegex!(`(?P
^|[ (\[])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?=[.,;:?!'"]?([ )\]]|$))`, "mg");
 static smid_inline_link_markup_regular                = ctRegex!(`(?P
^|[ (\[])\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
-static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg");
-static smid_inline_link_endnote_url_helper            = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
+static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg");
+static smid_inline_link_endnote_url_helper            = ctRegex!(`\{~\^\s+(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
 #+END_SRC
 
 #+BEGIN_SRC d
@@ -507,7 +507,6 @@ static make_breakcolumn                         = ctRegex!(`break=(?P.+?)】`, "m");
 static inline_notes_al_all_note                 = ctRegex!(`【(?P\d+|(?:[*]|[+])+)\s+(?P.+?)\s*】`, "mg");
 static inline_notes_al_regular_number_note      = ctRegex!(`【(?P\d+)\s+(?P.+?)\s*】`, "mg");
+// static inline_notes_al_all_note                 = ctRegex!(`【(?P\d+|(?:[*]|[+])+)\s+(?P.+?)\s*(≫\s\d+)?\s*】`, "mg"); // ocn of origin would be useful in endnote section
+// static inline_notes_al_regular_number_note      = ctRegex!(`【(?P\d+)\s+(?P.+?)\s*(≫\s\d+)?\s*】`, "mg"); // ocn of origin would be useful in endnote section
 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");
@@ -625,13 +626,14 @@ static inline_image                             = ctRegex!(`(?P
┥)☼(?P┥)☼(?P(?P[a-zA-Z0-9._-]+?\.(?:jpg|gif|png)),w(?P0)h(?P0))\s*(?P.*?┝┤.*?├)`, "mg");
 static inline_image_info                        = ctRegex!(`☼?(?P[a-zA-Z0-9._-]+?\.(?:jpg|gif|png)),w(?P\d+)h(?P\d+)`, "mg");
 static inline_link_anchor                       = ctRegex!(`┃(?P\S+?)┃`, "mg"); // TODO *~text_link_anchor
-static inline_link                              = ctRegex!(`┥(?P.+?)┝┤(?P#?(\S+?))├`, "mg");
-static inline_link_empty                        = ctRegex!(`┥(?P.+?)┝┤├`, "mg");
-static inline_link_number                       = ctRegex!(`┥(?P.+?)┝┤(?P[0-9]+)├`, "mg"); // not used
-static inline_link_number_only                  = ctRegex!(`(?P┥.+?┝)┤(?P[0-9]+)├`, "mg");
-static inline_link_stow_uri                     = ctRegex!(`┥(?P.+?)┝┤(?P[^ 0-9#┥┝┤├][^ 0-9┥┝┤├]+)├`, "mg"); // will not stow (stowed links) or object number internal links
-static inline_link_hash                         = ctRegex!(`┥(?P.+?)┝┤(?P#(?P\S+?))├`, "mg");
-static inline_link_seg_and_hash                 = ctRegex!(`┥(?P.+?)┝┤(?P(?P[^/#├]*)#(?P.+?))├`, "mg");
+// space cleaning should not be necessary
+static inline_link                              = ctRegex!(`┥\s*(?P.+?)\s*┝┤(?P#?(\S+?))├`, "mg");
+static inline_link_empty                        = ctRegex!(`┥\s*(?P.+?)\s*┝┤├`, "mg");
+static inline_link_number                       = ctRegex!(`┥\s*(?P.+?)\s*┝┤(?P[0-9]+)├`, "mg"); // not used
+static inline_link_number_only                  = ctRegex!(`\s*(?P\s*┥.+?┝)┤(?P[0-9]+)├`, "mg");
+static inline_link_stow_uri                     = ctRegex!(`┥\s*(?P.+?)\s*┝┤(?P[^ 0-9#┥┝┤├][^ 0-9┥┝┤├]+)├`, "mg"); // will not stow (stowed links) or object number internal links
+static inline_link_hash                         = ctRegex!(`┥\s*(?P.+?)\s*┝┤(?P#(?P\S+?))├`, "mg");
+static inline_link_seg_and_hash                 = ctRegex!(`┥\s*(?P.+?)\s*┝┤(?P(?P[^/#├]*)#(?P.+?))├`, "mg");
 static inline_link_clean                        = ctRegex!(`┤(?:.+?)├|[┥┝]`, "mg");
 static inline_link_toc_to_backmatter            = ctRegex!(`┤#(?Pendnotes|bibliography|bookindex|glossary|blurb)├`, "mg");
 static url                                      = ctRegex!(`https?://`, "mg");
-- 
cgit v1.2.3