Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mistune #81

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Draft

Upgrade mistune #81

wants to merge 12 commits into from

Commits on May 18, 2023

  1. Upgrade Mistune to version 3 (release candidate, so tentative)

    - header renderer function renamed to heading and args changed
    - link arguments changed
    - block_code arguments changed
    - image arguments changed and local filepath needs URL-decoding
    
    NB work in progress - tests not fixed
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    6c9f3dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b9a222 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c1536d3 View commit details
    Browse the repository at this point in the history
  4. New version of Mistune treats blockquotes separate by a blank line as…

    … separate elements
    
    - new Mistune behaviour is correct
    - we're trying to test a single blockquote with multiple paragraphs (where only the first line of each para has an angle bracket)
    - so add the exrta angle bracket on the blank line, to correspond with the intended output
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    899c989 View commit details
    Browse the repository at this point in the history
  5. New version of Mistune puts <blockquote> on a line of its own

    - no change to semantics of the output markup
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    5003452 View commit details
    Browse the repository at this point in the history
  6. The number of the first item in an ordered list affects the resulting…

    … markup
    
    - there is a substantial difference betwen the [syntax previously assumed](https://daringfireball.net/projects/markdown/syntax#list) and the [CommonMark syntax](https://spec.commonmark.org/0.30/#start-number)
    - Mistune now follows CommonMark so the example doc must change
    
    Arguably the example doc here is not testing md2cf functionality and should be removed
    
    - It's not particularly useful to test a lib that we depend on, unless we are testing something that matters to Confluence
    - Even then, deviation from CommonMark is not helpful, though potentially we could flag a warning somehow
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    579d09f View commit details
    Browse the repository at this point in the history
  7. Keep ConfluenceRenderer handling of code blocks same as Mistune Markd…

    …ownRenderer
    
    - all code blocks end with a newline
    - this means updating some examples in the functional test as they expected inconsistency
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    9a5e13d View commit details
    Browse the repository at this point in the history
  8. Align implemention of block_code with that in Mistune HTMLRenderer

    - add functional test of language tag on code block
    - fix unit test for block_code given renamed parameter
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    35de663 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9fbb343 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1474746 View commit details
    Browse the repository at this point in the history
  11. Add tests for both ways of handling newlines

    - turns out this is easy to break as Mistune behaviour has changed
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    457e923 View commit details
    Browse the repository at this point in the history
  12. Newline removal now has to be done in parsing rather than rendering d…

    …ue to the Mistune upgrade
    
    - each text callback occurs with a single line/token so doesn't receive the newline
    - instead we define a special InlineParser that handles soft break as spaces rather than newlines
    galund committed May 18, 2023
    Configuration menu
    Copy the full SHA
    f3cb5da View commit details
    Browse the repository at this point in the history