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

marked v14 will break code rendering #1420

Open
2 tasks
DerHerrGammler opened this issue Oct 26, 2024 · 3 comments
Open
2 tasks

marked v14 will break code rendering #1420

DerHerrGammler opened this issue Oct 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DerHerrGammler
Copy link
Contributor

Please provide the environment you discovered this bug in.

win 11
node v20
analogv 1.9.0

Which area/package is the issue in?

content

Description

Since markedjs changed the internal renderer in v13 to a tokenized renderer and removed the old renderer in v14 it will break the rendering process in analog of some markdown parts. If I discover it correctly analogs markdown renderer overrides some of the renderers functions and since the original renderer changed it now passing tokens to the functions wich the override cant convert correctly.

Here is the release notes of the breaking changes intoduces in v13:
https://github.com/markedjs/marked/releases/tag/v13.0.0

Please provide the exception or error you saw

It will render code parts as `[object Object]`

Other information

I'm not sure if we/analog should support this since analog is still installing marked v5 on new projects right now

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@DerHerrGammler DerHerrGammler added the bug Something isn't working label Oct 26, 2024
@brandonroberts
Copy link
Member

brandonroberts commented Nov 19, 2024

We could restrict the range of marked being installed to >=5 and <= 13, and potentially upgrade to a new version in 2.x

@DerHerrGammler
Copy link
Contributor Author

We could also implement it like marked-highlight did it here:
markedjs/marked-highlight@a14b49b

With that we would support the old syntax but up to v13 and the new token syntax starting from v13

@brandonroberts
Copy link
Member

Good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@brandonroberts @DerHerrGammler and others