Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: markedjs/marked
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.6
Choose a base ref
...
head repository: markedjs/marked
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.7
Choose a head ref
  • 6 commits
  • 11 files changed
  • 4 contributors

Commits on May 31, 2021

  1. chore(deps-dev): Bump rollup from 2.49.0 to 2.50.5 (#2076)

    Bumps [rollup](https://github.com/rollup/rollup) from 2.49.0 to 2.50.5.
    - [Release notes](https://github.com/rollup/rollup/releases)
    - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
    - [Commits](rollup/rollup@v2.49.0...v2.50.5)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 31, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b096f71 View commit details
  2. chore(deps-dev): Bump eslint-config-standard from 16.0.2 to 16.0.3 (#…

    …2077)
    
    Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 16.0.2 to 16.0.3.
    - [Release notes](https://github.com/standard/eslint-config-standard/releases)
    - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md)
    - [Commits](standard/eslint-config-standard@v16.0.2...v16.0.3)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 31, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c57b483 View commit details
  3. chore(deps-dev): Bump uglify-js from 3.13.7 to 3.13.8 (#2078)

    Bumps [uglify-js](https://github.com/mishoo/UglifyJS) from 3.13.7 to 3.13.8.
    - [Release notes](https://github.com/mishoo/UglifyJS/releases)
    - [Commits](mishoo/UglifyJS@v3.13.7...v3.13.8)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 31, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    69871c0 View commit details

Commits on Jun 1, 2021

  1. 1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    825a9f8 View commit details
  2. 🗜️ build [skip ci]

    MarkedJS bot committed Jun 1, 2021
    Copy the full SHA
    d88dc6e View commit details
  3. chore(release): 2.0.7 [skip ci]

    ## [2.0.7](v2.0.6...v2.0.7) (2021-06-01)
    
    ### Bug Fixes
    
    * em strong ([#2075](#2075)) ([825a9f8](825a9f8))
    semantic-release-bot committed Jun 1, 2021
    1
    Copy the full SHA
    7fe631e View commit details
35 changes: 18 additions & 17 deletions lib/marked.esm.js
Original file line number Diff line number Diff line change
@@ -858,7 +858,8 @@ var Tokenizer_1 = class Tokenizer {
let match = this.rules.inline.emStrong.lDelim.exec(src);
if (!match) return;

if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
// _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return;

const nextChar = match[1] || match[2] || '';

@@ -869,12 +870,13 @@ var Tokenizer_1 = class Tokenizer {
const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
endReg.lastIndex = 0;

maskedSrc = maskedSrc.slice(-1 * src.length + lLength); // Bump maskedSrc to same section of string as src (move to lexer?)
// Clip maskedSrc to same section of string as src (move to lexer?)
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);

while ((match = endReg.exec(maskedSrc)) != null) {
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];

if (!rDelim) continue; // matched the first alternative in rules.js (skip the * in __abc*abc__)
if (!rDelim) continue; // skip single * in __abc*abc__

rLength = rDelim.length;

@@ -892,25 +894,24 @@ var Tokenizer_1 = class Tokenizer {

if (delimTotal > 0) continue; // Haven't found enough closing delimiters

// If this is the last rDelimiter, remove extra characters. *a*** -> *a*
if (delimTotal + midDelimTotal - rLength <= 0 && !maskedSrc.slice(endReg.lastIndex).match(endReg)) {
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
}
// Remove extra characters. *a*** -> *a*
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);

// Create `em` if smallest delimiter has odd char count. *a***
if (Math.min(lLength, rLength) % 2) {
return {
type: 'em',
raw: src.slice(0, lLength + match.index + rLength + 1),
text: src.slice(1, lLength + match.index + rLength)
};
}
if (Math.min(lLength, rLength) % 2 === 0) {
return {
type: 'strong',
raw: src.slice(0, lLength + match.index + rLength + 1),
text: src.slice(2, lLength + match.index + rLength - 1)
};
}

// Create 'strong' if smallest delimiter has even char count. **a***
return {
type: 'strong',
raw: src.slice(0, lLength + match.index + rLength + 1),
text: src.slice(2, lLength + match.index + rLength - 1)
};
}
}
}
@@ -1215,9 +1216,9 @@ const inline$1 = {
emStrong: {
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
// (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
// () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
rDelimAst: /\_\_[^_]*?\*[^_]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
rDelimUnd: /\*\*[^*]*?\_[^*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
// () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
rDelimAst: /\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
rDelimUnd: /\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
},
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
br: /^( {2,}|\\)\n(?!\s*$)/,
Loading