diff --git a/README.md b/README.md index a170c0c..e89b06a 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ sanitize | false | Ignore any HTML that has been input. langPrefix | "lang-" | Prefix of class attribute of code block headerPrefix | "" | Prefix of id attribute of header safelist | See [Options.java](https://github.com/gitbucket/markedj/blob/master/src/main/java/io/github/gitbucket/markedj/Options.java) | Safelist of HTML tags. +extensions | empty | Extensions. See [Extensions](#extensions) section By default, markedj uses Jsoup's safelist mechanism for HTML rendering. It restricts renderable tags, attributes and even protocols of attribute values. For example, the image url must be `http://` or `https://` by default. You can remove this restriction by customizing the safelist as follows: @@ -75,9 +76,7 @@ String html = Marked.marked("> [!NOTE]\n> This is a note!", options); Support for github like [alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts). -For styling, some project-specific CSS is required. SVG icons are embedded but can be replaced by configuration. - -#### Usage +For styling, some project-specific CSS is required. ```java Options options = new Options(); @@ -89,72 +88,23 @@ options.addExtension(gfmAlerts); String html = Marked.marked("> [!NOTE]\n> This is a note!", options); ``` -#### Supported alert types +Supported alert types are `NOTE`, `TOP`, `IMPORTANT`, `WARNING`, and `CAUTION`. Here is a Markdown example: -**Note** ```markdown > [!NOTE] > Useful information that users should know, even when skimming content. ``` -**Note HTML** -```html -
-

Note

-

Useful information that users should know, even when skimming content.

-
-``` - -**Tip** -```markdown -> [!TIP] -> Helpful advice for doing things better or more easily. -``` -**Tip HTML** -```html -
-

Tip

-

Helpful advice for doing things better or more easily.

-
-``` -**Important** -```markdown -> [!IMPORTANT] -> Key information users need to know to achieve their goal. -``` -**Important HTML** -```html -
-

Important

-

Key information users need to know to achieve their goal.

-
-``` +This is translated to the following HTML: -**Warning** -```markdown -> [!WARNING] -> Urgent info that needs immediate user attention to avoid problems. -``` -**Warning HTML** ```html -
-

Warning

-

Urgent info that needs immediate user attention to avoid problems.

+
+

Note

+

Useful information that users should know, even when skimming content.

``` -**Caution** -```markdown -> [!CAUTION] -> Advises about risks or negative outcomes of certain actions. -``` -**Caution HTML** -```html -
-

Caution

-

Advises about risks or negative outcomes of certain actions.

-
-``` +Generated HTML can be customized by implementing your own renderer. [DefaultGFMAlertRenderer](https://github.com/gitbucket/markedj/blob/master/src/main/java/io/github/gitbucket/markedj/extension/gfm/alert/DefaultGFMAlertRenderer.java) is used by default. ## for Developers