improve markdown rendering
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
local M = {}
|
||||
|
||||
function M.setup(colors, config)
|
||||
local accent = colors[config.accent]
|
||||
|
||||
return {
|
||||
RenderMarkdownCode = { bg = accent.darkest },
|
||||
RenderMarkdownCodeBorder = { fg = colors.magenta.light, bg = colors.magenta.darker },
|
||||
RenderMarkdownCodeFallback = { fg = colors.fg },
|
||||
RenderMarkdownCodeInline = { fg = colors.magenta.light, bg = colors.magenta.darker },
|
||||
RenderMarkdownInlineHighlight = { fg = colors.yellow.light, bg = colors.yellow.darker }
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -97,7 +97,7 @@ function M.setup(opts)
|
||||
end
|
||||
end
|
||||
|
||||
for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini" }) do
|
||||
for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini", "render-markdown" }) do
|
||||
local mod = require("voltage.highlights.plugins." .. highlight)
|
||||
|
||||
for group, group_opts in pairs(mod.setup(colors, M.config)) do
|
||||
|
||||
+263
-2
@@ -1,3 +1,264 @@
|
||||
# Title
|
||||
# Markdown Test File - All Elements for Color Scheme Testing
|
||||
|
||||
This is **bold** and this is a [link](https://example.com)
|
||||
## Headings
|
||||
|
||||
# Heading 1
|
||||
## Heading 2
|
||||
### Heading 3
|
||||
#### Heading 4
|
||||
##### Heading 5
|
||||
###### Heading 6
|
||||
|
||||
---
|
||||
|
||||
## Text Formatting
|
||||
|
||||
**Bold text**
|
||||
|
||||
*Italic text*
|
||||
|
||||
***Bold and italic***
|
||||
|
||||
~~Strikethrough~~
|
||||
|
||||
`Inline code`
|
||||
|
||||
==Highlighted text==
|
||||
|
||||
H~2~O (subscript)
|
||||
|
||||
X^2^ (superscript)
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Lists
|
||||
|
||||
### Unordered List
|
||||
- Item 1
|
||||
- Item 2
|
||||
- Nested Item 2.1
|
||||
- Nested Item 2.2
|
||||
- Item 3
|
||||
|
||||
### Ordered List
|
||||
1. First item
|
||||
2. Second item
|
||||
1. Nested First
|
||||
2. Nested Second
|
||||
3. Third item
|
||||
|
||||
### Task List
|
||||
- [x] Completed task
|
||||
- [ ] Incomplete task
|
||||
- [ ] Another task
|
||||
|
||||
---
|
||||
|
||||
## Code Blocks
|
||||
|
||||
Inline `code` example.
|
||||
|
||||
```python
|
||||
# Python code block
|
||||
def hello_world():
|
||||
print("Hello, World!")
|
||||
return True
|
||||
```
|
||||
|
||||
```javascript
|
||||
// JavaScript code block
|
||||
const greet = (name) => {
|
||||
console.log(`Hello, ${name}!`);
|
||||
};
|
||||
```
|
||||
|
||||
```bash
|
||||
# Shell commands
|
||||
ls -la
|
||||
echo "Hello"
|
||||
```
|
||||
|
||||
```
|
||||
Plain text code block
|
||||
with multiple lines
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Blockquotes
|
||||
|
||||
> This is a blockquote.
|
||||
> It can span multiple lines.
|
||||
|
||||
> Nested blockquote:
|
||||
> > Deeper level
|
||||
|
||||
---
|
||||
|
||||
## Links and Images
|
||||
|
||||
[Regular link](https://example.com)
|
||||
|
||||
[Link with title](https://example.com "Example Title")
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
<https://example.com> (bare URL)
|
||||
|
||||
---
|
||||
|
||||
## Tables
|
||||
|
||||
| Syntax | Description | Test Text |
|
||||
|--------|-------------|-----------|
|
||||
| Header | Title | Here's this |
|
||||
| Paragraph | Text | And more |
|
||||
| `Code` | **Bold** | *Italic* |
|
||||
|
||||
| Left-aligned | Center-aligned | Right-aligned |
|
||||
|:-------------|:--------------:|--------------:|
|
||||
| Left | Center | Right |
|
||||
| Data | More Data | Even More |
|
||||
|
||||
---
|
||||
|
||||
## Horizontal Rules
|
||||
|
||||
___
|
||||
|
||||
---
|
||||
|
||||
***
|
||||
|
||||
---
|
||||
|
||||
## Footnotes
|
||||
|
||||
Here's a sentence with a footnote. [^1]
|
||||
|
||||
[^1]: This is the footnote text.
|
||||
|
||||
Another footnote reference. [^2]
|
||||
|
||||
[^2]: Second footnote.
|
||||
|
||||
---
|
||||
|
||||
## HTML Elements
|
||||
|
||||
<span style="color: red">HTML span</span>
|
||||
|
||||
<div style="background: #f0f0f0; padding: 10px">HTML div block</div>
|
||||
|
||||
<kbd>Keyboard input</kbd>
|
||||
|
||||
<details>
|
||||
<summary>Click to expand</summary>
|
||||
Hidden content here.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## Escaped Characters
|
||||
|
||||
\*This is not italic\*
|
||||
|
||||
\# Not a heading
|
||||
|
||||
\[Not a link\](https://example.com)
|
||||
|
||||
\`Not code\`
|
||||
|
||||
---
|
||||
|
||||
## Emoji
|
||||
|
||||
:smile: :heart: :rocket: :+1: :tada:
|
||||
|
||||
---
|
||||
|
||||
## Definition Lists
|
||||
|
||||
Term 1
|
||||
: Definition 1
|
||||
|
||||
Term 2
|
||||
: Definition 2a
|
||||
: Definition 2b
|
||||
|
||||
---
|
||||
|
||||
## Mixed Content
|
||||
|
||||
This is a **paragraph** with *various* `elements` [link](#) and .
|
||||
|
||||
- List with **bold** and *italic* items
|
||||
- Another `code` item
|
||||
- [Link in list](#)
|
||||
|
||||
> Blockquote with **formatting** and `code`
|
||||
|
||||
```python
|
||||
# Code with "quotes" and 'apostrophes'
|
||||
print("Hello, 'World'!")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Long Content for Scrolling
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl.
|
||||
|
||||
### Subsection with Code
|
||||
|
||||
```css
|
||||
/* CSS example */
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
color: #333333;
|
||||
}
|
||||
```
|
||||
|
||||
### Another Subsection
|
||||
|
||||
- Item
|
||||
- Item
|
||||
- Item
|
||||
|
||||
---
|
||||
|
||||
## Edge Cases
|
||||
|
||||
### Empty Elements
|
||||
|
||||
#### Empty code block
|
||||
```
|
||||
```
|
||||
|
||||
#### Empty blockquote
|
||||
>
|
||||
|
||||
#### Empty list items
|
||||
-
|
||||
-
|
||||
|
||||
### Special Characters
|
||||
|
||||
* * *
|
||||
|
||||
_ _ _
|
||||
|
||||
** **
|
||||
|
||||
__ __
|
||||
|
||||
` ` `
|
||||
|
||||
---
|
||||
|
||||
## End of File
|
||||
|
||||
Reference in New Issue
Block a user