12

A paragraph ending with a link having a tooltip is wrongly combined with the next paragraph. In some cases, the link is also corrupted and some of the markup shows up as content. At least one page “in the wild” which used to correctly display an embedded image no longer renders properly.

Here are several cases which demonstrate the problem.

Example 1: link with tooltip

In this example, the link is wrongly joined to the next paragraph.

[link text][reference1]
[reference1]: https://example.com/ "tooltip"

this should be a new paragraph

this should be a new paragraph

link text this should be a new paragraph

this should be a new paragraph

Example 2: link with tooltip containing barelink

In this example, the link is corrupted and some of the markup shows up as content.

[link text][reference2]
[reference2]: https://example.com/ "tooltip https://example.com/"

this should be a new paragraph

this should be a new paragraph

https://example.com/">link text this should be a new paragraph

this should be a new paragraph

Example 3: image link with tooltip

Like example 1, but with an image.

![link text][reference3]
[reference3]: https://example.com/ "tooltip"

this should be a new paragraph

this should be a new paragraph

link text this should be a new paragraph

this should be a new paragraph

Example 4: image link with tooltip containing barelink

Like example 2, but with an image.

![link text][reference4]
[reference4]: https://example.com/ "tooltip https://example.com/"

this should be a new paragraph

this should be a new paragraph

https://example.com/"> this should be a new paragraph

this should be a new paragraph

Example 5: example “in the wild”

The following post previously displayed an image embed but now displays no image and some of the markup shows up as content.

https://english.stackexchange.com/a/96967

  • Ah, the example answer you linked. That is right. I see now. – NVZ Jun 7 '17 at 20:00
  • in the thing you linked, changing ... "parts of an arm at <http://www.patient.co.uk/diagram/Arm.htm>" to "parts of an arm at &lthttp://www.patient.co.uk/diagram/Arm.htm>" makes the image appear just fine. you can't use unescaped </> there because the parser is broken but it has nothing to do with your core issue – cat Jun 7 '17 at 20:03
  • I'm not sure if what I did was right. I jumped in and did some edit. Hope that is not stepping on your toes. – NVZ Jun 7 '17 at 20:08
  • @NVZ I appreciate it. I went ahead and rolled it back though because currently it's serving as an example of the bug. – MetaEd Jun 7 '17 at 20:10
  • @MetaEd Sure. Anytime. :) – NVZ Jun 7 '17 at 20:10
  • @NVZ Changing the < to &lt makes the image appear, yes, and as soon as you add the required ; -- &lt; -- it disappears again. Behavior like that makes me want to keep poking stuff at it to see what it does ... fortunately somebody with actual knowledge of the code will be doing that instead. – MetaEd Jun 8 '17 at 13:10
  • @MetaEd Any update on this bug? – NVZ Jul 15 '17 at 12:30
  • @NVZ I assume we'll either hear something or possibly notice a parse change in my question. – MetaEd Jul 17 '17 at 21:42
3

This is how I have always seen it used. I'm not sure why you do it the way you show in the question.

[link text][covfefe]

this is a new paragraph
this is not a new paragraph

this is a new paragraph

 [covfefe]: https://example.com/ "tooltip"

link text

this is a new paragraph this is not a new paragraph

this is a new paragraph

  • 1
    the editor does it this way, and i'm pretty sure it's part of the SE markdown syntax that the hrefs for the links go after all content, with no following content – cat Jun 7 '17 at 20:00
  • @cat The markdown syntax doc is explicit that the link definition can be "anywhere in the document". But even if that were untrue, it would never be right for the HTML code generator to leak HTML markup as content. – MetaEd Jun 8 '17 at 12:22
  • Example #5 "in the wild" exhibits the bad behavior even though the link definitions are at the end of the document. – MetaEd Jun 8 '17 at 12:24
  • @MetaEd yes. I noticed that. See my first comment under your question. – NVZ Jun 8 '17 at 12:25
0

Or this way. I have never seen it the way it is shown in question.

[link text](https://example.com/ "tooltip") 

this should be a new paragraph

this should be a new paragraph

link text

this should be a new paragraph

this should be a new paragraph

  • I agree, there are some simple workarounds. My impetus for reporting this is not so much about getting that answer to format properly. It's about the leak of HTML code into the content of the document. If that is happening, then whatever's wrong with the parser could be serious -- a buffer overrun, or something else that could leave it open to an injection attack. – MetaEd Jun 8 '17 at 12:28
  • @MetaEd I've no idea about the technicalities. But I understand you. I've upvoted the question. – NVZ Jun 8 '17 at 12:36
  • @MetaEd Also, since this looks like a serious issue, have you posted on MSE? – NVZ Jun 8 '17 at 12:37
  • It's been brought up to a developer. It might or might not be serious, but somebody will make sure. – MetaEd Jun 8 '17 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .