[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Org-syntax: Intra-word markup

From: Max Nikulin
Subject: Re: Org-syntax: Intra-word markup
Date: Fri, 3 Dec 2021 21:53:59 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 03/12/2021 01:11, Tom Gillespie wrote:

I recommend anyone suggesting solutions try to implement
something that can parse the markup unambiguously with
lots of nasty test cases. You will likely find that it is impossible
to consistently tokenize markup, and that you have to hand
write a whole bunch of heuristics, making Org syntax even
harder to implement correctly.

Tom, I see and share you point, however sometimes more specific and convincing arguments are necessary.

Why unconstrained markup ("//") does not cause problems in asciidoc? Maybe it does but they are not immediately obvious. I don know since I have never used asciidoc. Maybe parser behaves in a different way than org-element. Maybe plain text links are not allowed at all. Almost any URL contains such pair of markers: https://orgmode.org/, so it should be addressed somehow.

Examples of corner cases that are used for tests should be more visible to users otherwise it is hard to use such samples in discussions. They should be annotated (arbitrary examples from recent discussions):

- input: [[https://first/-/url/][pre]] text [[https://second-url/?][post]]
  parsed: (
    (link :target "https://first/-/url/"; :description "pre")
    " text "
    (link :target "https://second-url/?"; :description "post"))
comment: "Regexp-based syntax highlighting falsely finds italic text because URLs have slashes similar start and end of italics"

- input: A _b =c_ d= e_ f
  parsed: (
    "A "
    (underline "b =c")
    " d= e_ f")
comment: "Users of markdown may falsely expect that c_ is protected by verbatim markers and underlined text is ended at e_"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]