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

[FEAT] Add support for GFM Alerts #532

Closed
DerGoogler opened this issue Dec 13, 2023 · 5 comments
Closed

[FEAT] Add support for GFM Alerts #532

DerGoogler opened this issue Dec 13, 2023 · 5 comments

Comments

@DerGoogler
Copy link

Could you add support for GFM Alerts?

Ref: https://github.com/orgs/community/discussions/16925

@quantizor
Copy link
Owner

How would you expect it to be implemented, putting the alert type in an <em> at the top of the <blockquote> or something? The library is intentionally un-opinionated about styles.

@quantizor
Copy link
Owner

With the new v7.4 renderRule option you can implement this yourself if desired by inspecting node.children for an appropriate first text child.

@DerGoogler
Copy link
Author

This option is awesome 👍

@robertotcestari
Copy link

Hello @DerGoogler did you implement this? Do you have an example code?

thanks!

@DerGoogler
Copy link
Author

DerGoogler commented Jul 6, 2024

@quantizor To add alerts like GitHub... isn't posible here ....

it returns something like this here:

[
  {
    "text": "[",
    "type": "27"
  },
  {
    "text": "!CAUTION",
    "type": "27"
  },
  {
    "text": "]\nNegative ",
    "type": "27"
  },
  {
    "text": "potential",
    "type": "5"
  },
  {
    "text": " consequences of an action.\nNegative ",
    "type": "27"
  },
  {
    "text": "potential",
    "type": "5"
  },
  {
    "text": " consequences of an action.",
    "type": "27"
  }
]

how I should parse such things?????

> [!CAUTION]
> Negative `potential` consequences of an action.
> Negative `potential` consequences of an action.

Caution

Negative potential consequences of an action.
Negative potential consequences of an action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants