idyll icon indicating copy to clipboard operation
idyll copied to clipboard

Links in [p] occassionally misbehave

Open nuclearGoblin opened this issue 5 years ago • 2 comments
trafficstars

Describe the bug Links in paragraph blocks point to the wrong place in some cases when text is placed between said paragraph blocks and inconsistent spacing is used.

Specifically, if I use three paragraph blocks, each containing links, and place text between the first two paragraph blocks (with no blank lines between [/p] or [p] and the text), the links in the third paragraph block function as the links in the first, following the same order that they were presented in the first. This issue goes away if there is a blank line before and after the text that occurs between paragraph blocks. It also goes away if there is no spacing between the second and third paragraph blocks.

To Reproduce An example that produces this bug:

[p]
[Google](https://google.com)
[/p]
asdf
[p]
[reddit](https://reddit.com)
[/p]

[p]
[yahoo](https://yahoo.com)
[/p]

In this example, the link labelled "yahoo" points to https://google.com when the page is built.

Expected behavior Links point to the url provided with the link, regardless of spacing between text and paragraph blocks. Alternatively, documentation specifies what spacing between code should be to prevent issues if misbehavior is expected to result from inconsistent spacing.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: Idyll version 4.12.0 (Also detected in 4.10.3)

Additional context Putting a blank line after text following the first paragraph block, but no blank line before the text, causes the second paragraph's links to misbehave instead of the third's. If the misbehaving paragraph block has more links than the first, the first so many links will misbehave but any "extra" links will function as normal.

nuclearGoblin avatar Jun 15 '20 20:06 nuclearGoblin

Thanks for flagging this @gerudo7, it definitely seems like a bug in the link handling logic in the compiler.

Have you noticed if this is only an issue when p-tags are at the top level or does the same thing persist if the tags are nested, e.g.

[div]

  [p] 
    ...
  [/p]

[/div]

mathisonian avatar Jun 15 '20 22:06 mathisonian

It looks like this still happens when they are nested like this, both when they are all in separate divs and when they are all in the same one.

nuclearGoblin avatar Jun 16 '20 00:06 nuclearGoblin