Markdown, Code Highlighting, and Footnotes
lightpaper.org renders Markdown to HTML using markdown-it with GFM (GitHub Flavored Markdown) extensions, Pygments syntax highlighting, and nh3 HTML sanitization. This gives you a rich set of formatting options while keeping everything secure.
This post covers every supported Markdown feature with examples.
Basic Formatting
Standard Markdown formatting works as expected:
- Bold with
**double asterisks** - Italic with
*single asterisks* - Strikethrough with
~~double tildes~~ Inline codewith`backticks`- Links with
[text](url)
These are the building blocks. Most documents use all of them.
Headings
Six levels of headings are supported:
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Headings are extracted for the table of contents and used by the quality scoring algorithm. Using 3 or more headings earns the maximum structure points for heading hierarchy.
In the paper format, headings are automatically numbered (1, 1.1, 1.2, 2, etc.) to provide the academic section numbering readers expect.
Code Blocks
Fenced code blocks with language identifiers get full Pygments syntax highlighting. Over 500 languages are supported.
```python
def publish(title, content):
response = httpx.post(
"https://lightpaper.org/v1/publish",
json={"title": title, "content": content}
)
return response.json()
```
This renders with syntax-highlighted colors for keywords, strings, functions, and other language elements.
Supported Languages
Some commonly used languages:
| Language | Identifier | Language | Identifier |
|---|---|---|---|
| Python | python |
JavaScript | javascript or js |
| TypeScript | typescript or ts |
Rust | rust |
| Go | go |
Java | java |
| C/C++ | c / cpp |
SQL | sql |
| Bash | bash or shell |
JSON | json |
| YAML | yaml |
HTML | html |
| CSS | css |
Markdown | markdown |
If no language is specified, Pygments attempts to guess the language from the content. For the most reliable highlighting, always specify the language.
Code blocks contribute to the substance component of the quality score. Including 4+ code blocks earns 5 substance points, and 2-3 blocks earn 3 points.
Tables
GFM-style tables are fully supported:
| Feature | Supported |
|---------|-----------|
| Tables | Yes |
| Alignment | Yes |
| Nested formatting | Yes |
Tables support column alignment with colons:
| Left | Center | Right |
|:-----|:------:|------:|
| a | b | c |
Tables are wrapped in a scrollable container on mobile devices, so wide tables remain usable on small screens. Including tables in your content adds up to 4 points to your substance score.
Task Lists
GFM task lists render as checkboxes:
- [x] Create an account
- [x] Publish first document
- [ ] Verify LinkedIn
- [ ] Submit credentials
This renders as an interactive-looking checklist (the checkboxes are read-only in the rendered output). Task lists are useful for tutorials, checklists, and project status updates.
Blockquotes
Standard blockquote syntax:
> The web has a publishing problem. Getting words onto a permanent URL
> shouldn't require a CMS or a deployment pipeline.
In the essay format, blockquotes are styled as pull quotes with distinctive typography, making them useful for highlighting key passages.
Nested blockquotes work as well:
> First level
>> Second level
>>> Third level
Footnotes
lightpaper.org supports Markdown footnotes via the markdown-it-footnote plugin:
This claim needs a source[^1]. And so does this one[^2].
[^1]: First reference — https://example.com
[^2]: Second reference with more detail about the source.
Footnotes render as superscript numbers in the text with a numbered footnote section at the bottom of the document. They're essential for academic writing and useful for any content that references external sources.
Footnotes contribute to the attribution score. Three or more footnotes earn 7 points; 1-2 earn 4 points.
Horizontal Rules
Three or more hyphens, asterisks, or underscores on a line:
---
This creates a visual separator between sections.
Images
Standard Markdown image syntax:

Images are sanitized to allow only http, https, and mailto URL schemes. The alt, title, width, and height attributes are preserved.
Lists
Both ordered and unordered lists are supported, including nested lists:
1. First item
- Nested bullet
- Another nested item
2. Second item
3. Third item
- Bullet one
- Bullet two
1. Nested numbered
2. Another nested
List items contribute to substance scoring. Five or more list items earn 4 points; 2-4 earn 2 points.
HTML Sanitization
All rendered HTML passes through nh3, a Rust-based HTML sanitizer. This means:
- Only whitelisted HTML tags are preserved (headings, paragraphs, links, code, tables, etc.)
- JavaScript is stripped entirely — no
<script>tags, noonclickhandlers, noURLs - Link attributes automatically include
rel="noopener noreferrer"for security - CSS
styleattributes are restricted to safe properties - Only
http,https, andmailtoURL schemes are allowed
This means you can't embed arbitrary HTML, but it also means published content is safe from XSS attacks. The sanitization happens server-side after Markdown rendering, so there's no way to bypass it.
Formatting Tips for Quality
To maximize your quality score through formatting:
- Use 3+ headings for structure (10 points)
- Include code blocks for substance (up to 5 points)
- Add tables where data is tabular (up to 4 points)
- Use footnotes for citations (up to 7 attribution points)
- Add a References section heading (8 attribution points)
- Vary paragraph lengths for natural rhythm (up to 7 structure points)