Code blocks bugged when empty lines present inside them

in #utopian-io7 years ago (edited)

Utopian.io

Utopian.io logo by Utopian.io

Utopian.io is a superb initiative that helps many open source projects to thrive. I enjoy using it a lot, because I really feel that contributing has a real value – both for the project and for me as a contributor who decides to spend his time on free, open source projects.

Recently I came across a bug in the post editor, where having a blank line inside a code block causes the preview to ommit the block's ending and renders everything that comes after it as a part of this code block.

Expected behaviour

Expected behaviour is of course that the preview box under the textarea renders correctly – just like the final post after publishing does.

Actual behaviour

As mentioned before, bug is present in the post editor. It causes remaining part of the post (all that his below the bugged code block) to render inside this bugged code block.

This bug does not affect the actual published post. It seems to only be present inside this Preview panel.

How to reproduce

Create a new post inside the Utopian.io app, and inside this post create a code block. It does not matter what is put inside that, the bug appears whenever there is a blank line inside the code block. Below I attach a screenshot with a code that triggers the bug (twice). Sorry for doing it as a screenshot, but it is the only way to present it. Here's a Github Gist with the code that triggers the bug.

Code that triggers the bug

Source: my own materials

And that's how it renders in the preview panel:

Bugged preview rendering

Source: my own materials

  • Browser: Firefox 57.0.4 (64-bit), Chromium 62.0.3202.94 (64-bit)
  • Operating system: Ubuntu 17.10



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it is a duplicate. It is very similar to a contribution that was already accepted here. This issue also talks about the closing tag of the code block is not being detected.

You can contact us on Discord.
[utopian-moderator]

Coin Marketplace

STEEM 0.21
TRX 0.13
JST 0.029
BTC 67557.12
ETH 3500.56
USDT 1.00
SBD 2.70