Comments (7)
I think if you want em + strong you need to use underscores. From what I understand, 3 asterisks is supposed to be used in order to produce actual asterisks, e.g. foo bar
from markdown-js.
@lorddev Having ***foo bar***
produce <em><strong>foo bar</strong></em>
is consistent with at least StackOverflow's and GitHub's markdown. To produce asterisks around bolded text would be with escaped asterisks **\*foo bar\***
, which works fine and seems most intuitive.
from markdown-js.
Ok. I must having been thinking of Google+, which implements only the asterisks and underscores subset of markdown.
from markdown-js.
This is quite probably a parsing bug as most other parsers treat it as <strong><em>foo bar</em></strong>
as you can see here: http://babelmark.bobtfish.net/?markdown=***foo+bar***
(I know I made some decisions on purpose of what to parse and what to just ignore but I don't think this was one of them)
from markdown-js.
@ashb That's what I think too. I apologize for not submitting a pull request; I'm still learning the code base and how the parsing works. I did, however, add the test case in the inline_strong_em
of regressions.t.js
and it failed.
from markdown-js.
The parsing of strong and em is a little bit ... interesting (along with most of the rest of the parsing) and has some fruity backtracking like stuff in it. The strong_em
helper function is what deals parsing of **
Line 977 in 50f6d69
from markdown-js.
Hmmm I've taken a look and the way the strong/em state is currently split out is what's causing the problem I suspect.
The problem is that it doesn't keep the ordering of which of a strong/em was last opened, so it closes the wrong one (the strong) as this is first in the regex pattern and doesn't know that it should check if it should close an em instead of a strong.
I suspect we'll have to rewrite that parser helper func to use a single state variable instead of two split ones.
from markdown-js.
Related Issues (20)
- Link to `lib/markdown.js` not working in readme HOT 1
- Strikethrough component doesn't work. HOT 1
- Code Syntax Highlight
- Unable to resolve module `../../constants/index` from `D:\GitHub\medred\app\src\ stories\screens\Specialty\index.js`: could not resolve `D:\GitHub\medred\app\src \stories\constants\index' as a folder: it did not contain a package, nor an inde x file
- Can't distinguish code language HOT 1
- support parase "[TOC]"? HOT 1
- [BUG] href not correctly parsed when text and its url both contains underscore. HOT 3
- *** Text *** parse was strong , but Italic not effective HOT 1
- Two links following one another
- Add note to README that this repo is not maintained HOT 2
- The speed of the Markdown-js is too bad. HOT 2
- Load external Markdown File in html.
- Inline HTML is escaped? HOT 2
- Vulnerability issue HOT 2
- 🚨 Potential Security Vulnerability HOT 1
- Trying to get in touch regarding a security issue HOT 1
- Images not getting converted properly in certain cases
- (wrong repository) HOT 1
- the "table" cannot use HOT 4
- how to convert .md file into .html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown-js.