question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image on a newline is not parsed correctly

See original GitHub issue

With markdown like this:

Sample image:

<img src="https://upload.wikimedia.org/wikipedia/en/f/f4/Unrealtournament.jpg" />

Image is parsed as HtmlBlock by Commonmark parser, not as HtmlInline, later this is handled by SpannableMarkdownVisitor::visit(HtmlBlock htmlBlock) which assumes tag as null and passes it to Html.fromHtml which doesn’t support images.

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
notiescommented, Aug 22, 2018

Hey @Adonai !

About Jsoup. It turned out that it’s not that heavy. And if you strip all unused code that does selectors and fixing malicious HTML content, it’s about ~100KB. I think for the control that we get over HTML it bearable. Anyway, Jsoup (like TagSoup) cannot be used by Markwon directly as they do not allow processing HTML input in chunks. I had to repackage Jsoup parsing (Tokeniser) functionality and introduce some minor changes. There is still ability to not include HTML parser (it is in different artifact). And there is of cause an ability to provide own implementation (API is defined in markwon-html-parser-api artifact, you can inspect it, and maybe create something that will answer your needs).

About documentation. I used vuepress. It’s absolutely amazing. At least compared with Jekyll. It’s perfect for technical documentation (not so good for blogging though). I think it’s the engine behind all Vue.js documentation (pretty cool also).

About markdown fragment that you provided. I just used commonmark-dingus and it renders it the same. Adding a <br> makes text after image to be in a different paragraph.

0reactions
Kaned1ascommented, Aug 21, 2018

Minor note:

This markdown:

Вчера посетили самый большой кантон Швейцарии - Граубюнден. Проложили маршрут мимо озер Lag Prau Tulerigt и Caumasee к Рейнскому ущелью. [MORE=Прогуляться вместе с нами.]Озеро Lag Prau Tulerigt очень нас удивило: добравшись по карте до нужного места мы увидели огромный луг. Оказалось, что у этого озера очень колеблется уровень воды, осенью оно практически полностью высыхает, но август был безумно жаркий и без дождей, так что, видимо, оно решило высохнуть раньше.

<img alt="изображение" src="https://sun9-2.userapi.com/c831508/v831508485/17b51a/wFmqNOc1LfQ.jpg" width="80%" />

Небольшое количество воды в озере все-таки обнаружено!

looks like this:

image

i.e. the image is on a new paragraph but the text following it is not, just a line break. Is this expected behaviour?

Read more comments on GitHub >

github_iconTop Results From Across the Web

New line character is appended when a image is downloaded ...
1 Answer 1 ... I do not know why empty line is getting appended, but when tries to create the same scenario of...
Read more >
[JENKINS-31573] New line characters are not parsing correctly
To address this issue I submitted a pull request to force parsing as a standard Java properties object and then also extracted the...
Read more >
FAQ - Newline Interactive
5. Navigate to Control Panel>Display Settings>Change Display Settings and under the “Multiple displays” drop down window, select “Duplicate these displays” and ...
Read more >
Common Questions - Technical Support - Freshdesk
Issue: Touch functionality is off or not working as expected To get started ... in extended mode **For MacOS visit: Helpdesk : Newline...
Read more >
PuTTY new line not working properly - Super User
And PuTTY does go to the next line but does not reset the column. Shown here enter image description here. How can I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found