Skip to content

Releases: quantizor/markdown-to-jsx

v7.4.7

13 Apr 06:44
acd970d
Compare
Choose a tag to compare

Patch Changes

  • 7603248: Fix parsing isolation of individual table cells.
  • f9328cc: Improved block html detection regex to handle certain edge cases that cause extreme slowness. Thank you @devbrains-com for the basis for this fix 🤝

v7.4.6

05 Apr 19:07
ede3cd8
Compare
Choose a tag to compare

Patch Changes

  • a9e5276: Browsers assign element with id to the global scope using the value as the variable name. E.g.: <h1 id="analytics"> can be referenced via window.analytics.
    This can be a problem when a name conflict happens. For instance, pages that expect analytics.push() to be a function will stop working if the an element with an id of analytics exists in the page.

    In this change, we export the slugify function so that users can easily augment it.
    This can be used to avoid variable name conflicts by giving the element a different id.

    import { slugify } from 'markdown-to-jsx';
    
    options={{
      slugify: str => {
        let result = slugify(str)
    
        return result ? '-' + str : result;
      }
    }}

v7.4.5

22 Mar 20:10
9012179
Compare
Choose a tag to compare

Patch Changes

  • f5a0079: fix: double newline between consecutive blockquote syntax creates separate blockquotes

    Previously, for consecutive blockquotes they were rendered as one:

    Input

    > Block A.1
    > Block A.2
    
    > Block B.1

    Output

    <blockquote>
      <p>Block A.1</p>
      <p>Block A.2</p>
      <p>Block.B.1</p>
    </blockquote>

    This is not compliant with the GFM spec which states that consecutive blocks should be created if there is a blank line between them.

v7.4.4

21 Mar 04:16
Compare
Choose a tag to compare

What's Changed

New Contributors

  • @zegl made their first contribution in #551
  • @austingreco made their first contribution in #550
  • @github-actions made their first contribution in #556

Full Changelog: v7.4.3...v7.4.4

v7.4.3

13 Mar 00:43
d5cf45f
Compare
Choose a tag to compare

What's Changed

  • fix: restore x-browser stable sort logic in #548 (fixes unclosed HTML tags that showed up for some edge cases)

Full Changelog: v7.4.2...v7.4.3

v7.4.2

12 Mar 14:31
Compare
Choose a tag to compare

Re-release 7.4.1 with less existential console screaming

v7.4.1

29 Jan 19:26
17e1455
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v7.4.0...v7.4.1

v7.4.0

01 Jan 05:35
Compare
Choose a tag to compare

Happy New Year! 🎆

markdown-to-jsx v7.4 features a new option renderRule! — From the README:

Supply your own rendering function that can selectively override how rules are rendered (note, this is different than options.overrides which operates at the HTML tag level and is more general). You can use this functionality to do pretty much anything with an established AST node; here's an example of selectively overriding the "codeBlock" rule to process LaTeX syntax using the @matejmazur/react-katex library:

import { Markdown, RuleType } from 'markdown-to-jsx'
import TeX from '@matejmazur/react-katex'

const exampleContent =
  'Some important formula:\n\n```latex\nmathbb{N} = { a in mathbb{Z} : a > 0 }\n```\n'

function App() {
  return (
    <Markdown
      children={exampleContent}
      options={{
        renderRule(next, node, renderChildren, state) {
          if (node.type === RuleType.codeBlock && node.lang === 'latex') {
            return (
              <TeX as="div" key={state.key}>{String.raw`${node.text}`}</TeX>
            )
          }

          return next()
        },
      }}
    />
  )
}

The README docs around syntax highlighting have also been updated with sample code.

With the new year comes a push toward v8. Performance will be a top priority, reducing the complexity of the library's regexes to increase throughput for SSR use-cases and ideally eliminate rare but frustrating issues like catastrophic backtracking. In addition, the library will be pivoting into more of a pure compiler model, with a React adapter offered and ones added for other major frameworks as well. The idea is anywhere you can run JS, you can use [secret new library name].

Stay tuned and thanks for being part of the journey ✌🏼
Here's to a great 2024 🍾

markdown-to-jsx is maintained by @quantizor, buy him a coffee

Full Changelog: v7.3.2...v7.4.0

v7.3.2

05 Aug 15:29
ef6898d
Compare
Choose a tag to compare

fix(types): path to esm types in "exports"

Full Changelog: v7.3.1...v7.3.2

v7.3.1

03 Aug 14:13
Compare
Choose a tag to compare

What's Changed

  • add dev-time error if trying to provide bad input

Full Changelog: v7.3.0...v7.3.1