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: mdx-js/mdx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.20.0
Choose a base ref
...
head repository: mdx-js/mdx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.20.1
Choose a head ref
  • 2 commits
  • 7 files changed
  • 1 contributor

Commits on Mar 2, 2019

  1. Fix template string escaping (#431)

    We need to escape template strings after back slash
    escaping so that unescaping template strings doesn't
    happen by accident.
    
    ---
    
    Fixes #430
    johno authored Mar 2, 2019

    Verified

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

    johno committed Mar 2, 2019
    1
    Copy the full SHA
    6b9cfd4 View commit details
Showing with 13 additions and 10 deletions.
  1. +1 −1 lerna.json
  2. +2 −2 packages/loader/package.json
  3. +1 −1 packages/mdx/package.json
  4. +4 −1 packages/mdx/test/index.test.js
  5. +1 −1 packages/mdx/util.js
  6. +2 −2 packages/parcel-plugin-mdx/package.json
  7. +2 −2 packages/runtime/package.json
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.0",
"version": "0.20.0",
"version": "0.20.1",
"packages": [
"packages/*"
],
4 changes: 2 additions & 2 deletions packages/loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdx-js/loader",
"version": "0.20.0",
"version": "0.20.1",
"description": "Loader for MDX",
"license": "MIT",
"keywords": [
@@ -27,7 +27,7 @@
"index.js"
],
"dependencies": {
"@mdx-js/mdx": "^0.20.0",
"@mdx-js/mdx": "^0.20.1",
"@mdx-js/tag": "^0.18.0",
"loader-utils": "^1.1.0"
},
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdx-js/mdx",
"version": "0.20.0",
"version": "0.20.1",
"description": "Parse MDX and transpile to JSX",
"license": "MIT",
"keywords": [
5 changes: 4 additions & 1 deletion packages/mdx/test/index.test.js
Original file line number Diff line number Diff line change
@@ -70,7 +70,10 @@ it('Should output parseable JSX', async () => {
})

it('Should be able to render JSX with React', async () => {
const result = await renderWithReact('# Hello, world!')
const result = await renderWithReact(`# Hello, world!
const code = () => \`template string\`
`)

expect(result).toContain('<h1 style="color:tomato">Hello, world!</h1>')
})
2 changes: 1 addition & 1 deletion packages/mdx/util.js
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ const EMPTY_NEWLINE = '\n\n'

const toTemplateLiteral = text => {
const escaped = text
.replace(/`/g, '\\`') // Escape "`"" since
.replace(/\\/g, '\\\\') // Escape all "\" to avoid unwanted escaping in text nodes
.replace(/`/g, '\\`') // Escape "`"" since

return '{`' + escaped + '`}'
}
4 changes: 2 additions & 2 deletions packages/parcel-plugin-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdx-js/parcel-plugin-mdx",
"version": "0.20.0",
"version": "0.20.1",
"description": "Parcel plugin for MDX",
"license": "MIT",
"keywords": [
@@ -27,7 +27,7 @@
"src"
],
"dependencies": {
"@mdx-js/mdx": "^0.20.0",
"@mdx-js/mdx": "^0.20.1",
"parcel-bundler": "^1.4.1"
},
"peerDependencies": {
4 changes: 2 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdx-js/runtime",
"version": "0.20.0",
"version": "0.20.1",
"description": "Parse and render MDX in a runtime environment",
"license": "MIT",
"keywords": [
@@ -33,7 +33,7 @@
"src/"
],
"dependencies": {
"@mdx-js/mdx": "^0.20.0",
"@mdx-js/mdx": "^0.20.1",
"@mdx-js/tag": "^0.18.0",
"buble": "^0.19.6"
},