pml-lang / pml-companion

Java source code of the 'PML Companion (PMLC)'
https://www.pml-lang.dev
GNU General Public License v2.0
22 stars 1 forks source link

Equal sign in query string needs escaping #40

Closed celtic-coder closed 3 years ago

celtic-coder commented 3 years ago

Hi Christian(@pml-lang),

I have found that a [link tag does not resolve correctly if a query string exists in the URL. I need to escape the = sign for the link to appear correctly in the HTML output. Here is a working example:

link-tag-with-query-string

The query string ?ref= will not work if entered "as-is". A broken URL up to the question mark appears in the output. I'm guessing that why the = needs escaping, is because the [link tag is expecting the next parameter and is not checking that it is preceded by the text attribute.

This is not a high priority issue since I have found a workaround.

Kind Regards, Liam

pml-lang commented 3 years ago

Hi Liam (@celtic-coder),

In the current version you must indeed escape the = (as you did). Alternatively you can quote the URL if it contains a =, e.g.

[link url="http://example.com/foo?p1=v1" text=example]

The new parser will support the syntax with quotes, as well as without quotes and = instead of \=. But it will not support \=, because there is no need for it anymore.

Hence, the safest way is to quote the URL.

celtic-coder commented 3 years ago

Yes, quoting the URL seems to be the most straightforward solution. Thanks!