Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiline link urls no longer trimmed and concatenated #64

Open
ztatlock opened this issue Oct 7, 2023 · 4 comments
Open

multiline link urls no longer trimmed and concatenated #64

ztatlock opened this issue Oct 7, 2023 · 4 comments

Comments

@ztatlock
Copy link

ztatlock commented Oct 7, 2023

Previously djot would allow me to have long urls split across lines:

[link](
  https://some-really-long-url/
  with-several-parts/
  that-i-want-across-lines)

Before 0.2.4, it would eliminate the whitespace between those URL components:

$ djot test.dj 
<p><a href="https://some-really-long-url/with-several-parts/that-i-want-across-lines">link</a></p>

However, with 0.2.4, it now keeps spaces in the URL:

$ djot test.dj 
<p><a href="  https://some-really-long-url/  with-several-parts/  that-i-want-across-lines">link</a></p>

I didn't notice at first because the browser seems to "do the right thing", but is this intended / guaranteed to always work?

Many thanks for all the great work on djot!!

@jgm
Copy link
Owner

jgm commented Oct 7, 2023

yes it's a bug!

@jgm
Copy link
Owner

jgm commented Oct 7, 2023

Culprit is commit 1b5425c
Note that this commit also causes problems for, e.g.

> [link](a
> b)

-- the > is included in the URL. Back to the drawing board.

@faelys
Copy link

faelys commented Oct 9, 2023

I'm not sure this is the best place to mention it, but #46 feels somewhat related to what I discussed in djot#247. Briefly I propose to consider that link URLs, references, and attribute blocks should change the parser mode, just like raw text in code spans, which has indirect impact in how invalid constructs are parsed (automatically closed at the end of bock, just like code spans).

@jgm
Copy link
Owner

jgm commented Oct 9, 2023

Yes, the complexity in #46 is needed because we want to allow you to have regular text after something that would (if properly continued) introduce an attribute or link or reference.

These

[hi](*emph*

[hi][*emph*

[hi]{.class *emph*

become

<p>[hi](<strong>emph</strong></p>
<p>[hi][<strong>emph</strong></p>
<p><span>hi</span>{.class <strong>emph</strong></p>

You're asking whether that's something we should want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants