ESC
ไวยากรณ์ Markdown

Headings

Syntax Shorthand Example Rendered Notes
# Heading H1 # My Title H1 Largest heading; maps to <h1>
## Heading H2 ## Section H2 Maps to <h2>
### Heading H3 ### Subsection H3 Maps to <h3>
#### Heading H4 #### Detail H4 Maps to <h4>
##### Heading H5 ##### Note H5 Maps to <h5>
###### Heading H6 ###### Fine print H6 Smallest heading; maps to <h6>

Emphasis

Syntax Shorthand Example Rendered Notes
**text** Bold **hello** hello Also __text__
*text* Italic *hello* hello Also _text_
***text*** Bold + Italic ***hello*** hello Also ___text___
~~text~~ Strikethrough ~~hello~~ hello Requires GFM support
`code` Inline code `var x = 1` var x = 1 Monospace; escapes HTML

Links & Images

Syntax Shorthand Example Rendered Notes
[text](url) Inline link [Google](https://google.com) Google Opens in same tab by default
[text](url "title") Link + title [G](https://g.com "Go") Google Title shown on hover
[text][ref] Reference link [Google][g] ... [g]: url Google Define URL elsewhere in doc
![alt](url) Inline image ![Logo](logo.png) <img> Alt text improves accessibility
<url> Autolink <https://example.com> link URL or email becomes clickable

Lists

Syntax Shorthand Example Rendered Notes
- item Unordered - Apple - Banana * Apple Also * or + as bullet
1. item Ordered 1. First 2. Second 1. First Numbers auto-increment in output
- nested Nested list - Item - Sub * Item > Sub Indent 2+ spaces to nest
- [ ] task Task (unchecked) - [ ] Todo [ ] Todo GitHub Flavored Markdown
- [x] task Task (checked) - [x] Done [x] Done GFM checked task item

Code Blocks

Syntax Shorthand Example Rendered Notes
```lang Fenced block ```js code ``` <pre> Language hint enables syntax highlight
code Indented block let x = 1; <pre> 4 spaces or 1 tab indentation
`code` Inline code Use `npm install` npm install Single backtick pair

Blockquotes

Syntax Shorthand Example Rendered Notes
> text Blockquote > This is a quote " quote Renders as <blockquote>
>> text Nested quote >> Inner quote "" inner Double > for nested blockquote
> **Note** Callout style > **Warning:** text callout Bold first word for callout pattern

Tables

Syntax Shorthand Example Rendered Notes
| Col | Col | Header row | Name | Age | <th> Pipes define columns
|-----|-----| Separator | --- | --- | divider Required after header row
| :--- | Left align | :--- | left Colon on left side
| ---: | Right align | ---: | right Colon on right side
| :---: | Center align | :---: | center Colons on both sides

Horizontal Rules

Syntax Shorthand Example Rendered Notes
--- Rule (hyphens) --- <hr> Three or more hyphens
*** Rule (asterisks) *** <hr> Three or more asterisks
___ Rule (underscores) ___ <hr> Three or more underscores

Escaping

Syntax Shorthand Example Rendered Notes
\* Escape char \*literal\* *literal* Backslash escapes: \\ ` * _ { } [ ] ( ) # + - . !

คำถามที่พบบ่อย

Markdown คือภาษามาร์กอัปน้ำหนักเบาที่สร้างโดย John Gruber ในปี 2004 ที่ช่วยให้คุณเขียนข้อความธรรมดาที่แปลงเป็น HTML ได้ บรรทัดที่ขึ้นต้นด้วย # จะกลายเป็น <h1>, **ข้อความ** จะเป็นตัวหนา และ *ข้อความ* จะเป็นตัวเอียง เนื่องจากอ่านได้อย่างเป็นธรรมชาติในรูปแบบข้อความธรรมดาและแสดงผล HTML ที่สะอาด จึงกลายเป็นมาตรฐานสำหรับไฟล์ README เอกสาร ฟอรัม เช่น Reddit และ Stack Overflow และแอปจดบันทึก

CommonMark คือข้อกำหนดที่เข้มงวดและชัดเจนสำหรับ Markdown ที่แก้ปัญหาความไม่สม่ำเสมอหลายปีระหว่างการใช้งาน GitHub Flavored Markdown (GFM) ขยาย CommonMark ด้วยรายการงาน (- [ ] / - [x]) ตาราง ข้อความขีดทับ (~~ข้อความ~~) และลิงก์อัตโนมัติ แพลตฟอร์มสำหรับนักพัฒนาส่วนใหญ่ — GitHub, GitLab, VS Code — ใช้ GFM

บรรทัดว่างสร้างย่อหน้าใหม่ สำหรับการขึ้นบรรทัดใหม่ภายในย่อหน้าโดยไม่เริ่มใหม่ ให้จบบรรทัดด้วยช่องว่างสองช่องขึ้นไปก่อนกด Enter วิธีที่ปลอดภัยที่สุดแบบข้ามแพลตฟอร์มคือใช้บรรทัดว่างสำหรับการแบ่งย่อหน้า และแท็ก HTML <br> สำหรับการแบ่งกลางย่อหน้า