BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Single Quotes in code block gets replaced to ' #2237

Closed shapeoflambda closed 6 years ago

shapeoflambda commented 6 years ago

Single Quotes in code block gets replaced to '

I have to add lot of javascript code snippets and curl commands to my notes collection and they extensively use single quotes. Sadly, all my single quotes are being replaced by '

Expected behavior

Single quotes are displayed as single quotes

Steps to reproduce

  1. Create a new markdown note with a code block containing single quotes.

Environment

cacauisadog commented 6 years ago

I've been having this problem for some days too. Same version and OS.

jonyhayama commented 6 years ago

I'm having a similar problem... I'm getting escaped question marks too... Same version, but running on Windows 10

shapeoflambda commented 6 years ago

Tried some debugging and following are my observations:

  1. The issue is happening only when the code block is closed by . So temporary workaround will be to remove the closing However this works only if there's no text below your code block.

  2. The issue is because the special characters are replaced using HTML encoding here: https://github.com/BoostIO/Boostnote/blob/master/browser/components/MarkdownPreview.js#L451 Removing the encoding step, the special characters $<>'? are rendered correctly.

shapeoflambda commented 6 years ago

Pull Request: https://github.com/BoostIO/Boostnote/pull/2240

IssueHuntBot commented 6 years ago

@boostio funded this issue with $40. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@boostio cancelled funding, $40, of this issue. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@kazup01 funded this issue with $10. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@kazup01 cancelled funding, $10, of this issue. Visit this issue on Issuehunt