Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Sep 19, 2021
1 parent 6e55d65 commit ab0e0a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -54,7 +54,7 @@ marked:
- **smartypants** - Use "smart" typographic punctuation for things like quotes and dashes.
- **quotes** - Defines the double and single quotes used for substituting regular quotes if **smartypants** is enabled.
* Example: '«»“”'
* "double" will be turned into «single»
* "double" will be turned into «double»
* 'single' will be turned into “single”
* Both double and single quotes substitution must be specified, otherwise it will be silently ignored.
- **modifyAnchors** - Transform the anchorIds into lower case (`1`) or upper case (`2`).
Expand Down
4 changes: 2 additions & 2 deletions lib/renderer.js
Expand Up @@ -216,15 +216,15 @@ class Tokenizer extends MarkedTokenizer {
}

// Override smartypants
inlineText(src, inRawBlock) {
inlineText(src) {
const { options, rules } = this;
const { quotes, smartypants: isSmarty } = options;

// https://github.com/markedjs/marked/blob/b6773fca412c339e0cedd56b63f9fa1583cfd372/src/Tokenizer.js#L643-L658
const cap = rules.inline.text.exec(src);
if (cap) {
let text;
if (inRawBlock) {
if (this.lexer.state.inRawBlock) {
text = cap[0];
} else {
text = escape(isSmarty ? smartypants(cap[0], quotes) : cap[0]);
Expand Down

0 comments on commit ab0e0a1

Please sign in to comment.