xLog
xLog
The First On-Chain and Open-Source Blogging platform

xLog Flavored Markdown

image

This post is to explain and demonstrate the Markdown syntax supported by xLog.

If you have any questions or suggestions, feel free to submit an issue or comment.

Follows GitHub Flavored Markdown (GFM)

Specification details: https://github.github.com/gfm

Examples:

  1. ## Heading level 2

    Heading level 2

  2. **Bold**

    Bold

  3. > Quote

    Quote

  4. List

    1. Normal list

      - list 1
      - list 2
      • list 1
      • list 2
    2. Ordered list

      1. - ordered list 1
      1. - ordered list 2
      1. ordered list 1
      2. ordered list 2
    3. Task list

      - [ ] task list 1
      - [x] task list 2
      • task list 1
      • task list 2
  5. Code

    `code`

    code

    ```js
    console.log("xLog")
    console.log("is the best!")
    ```
    
    console.log("xLog")
    console.log("is the best!")
    
  6. Thematic break ---


  7. Link [link title](url)

    link title

  8. Image ![image title](ipfs://bafkreiabgixxp63pg64moxnsydz7hewmpdkxxi3kdsa4oqv4pb6qvwnmxa)

    image title

  9. *Italic*

    Italic

  10. Autolink

    https://xlog.app

  11. ~~Strikethrough~~

    Strikethrough

  12. Table

    foobar
    bazbim

Allowed HTML Tags and Attributes

See: https://github.com/Crossbell-Box/xLog/blob/main/src/markdown/sanitize-schema.ts

For security reasons, only whitelisted HTML tags and attributes are allowed, but this is not set in stone, so if you need other tags or attributes, feel free to submit a pr or issue.

Examples:

<audio src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4" controls></audio>

Supports Generic Directives Proposal

Specification details: https://talk.commonmark.org/t/generic-directives-plugins-syntax/444

Examples:

  1. line1 :br line2 :i[HTML]{class="test"} => line1 <br> line2 <i class="test">HTML</i>

    line1
    line2 HTML

  2. ::video[title]{src=https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4 controls=true} => <video src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4" controls="">title</video>

  3. :::div{style="text-align: center"}
    Centered Content
    :::
    

    => <div style="text-align: center"><p>Centered Content</p></div>

    Centered Content

Supports Mathematical Expressions

This sentence uses $ delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$ 3x1+(1+x)2\sqrt{3x-1}+(1+x)^2

To add a math expression as a block, start a new line and delimit the expression with two dollar symbols $$.

$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$

(k=1nakbk)2(k=1nak2)(k=1nbk2)\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

Built-in components

YouTube

::youtube{#pLBX9vdrtn4}

Mention

:mention{#xlog}

@xlog

      0 Comment

      © xlog · Powered by xLog