Some language servers like (haskel-language-server, rust-analyzer) returns MarkupContent { kind: "markdown", value: "..." } for documentation. However when rendering it in Webkit it was wrapped in ```markdown <contents> ``` one more time, confusing the JS library showdown.
This PR
Removes the ```markdown <contents> ``` wrapper when MarkupContent.kind == "markdown"
Create a CSS variable for webkit width size that is configurable from emacs.
Add white-space: pre-wrap for <code> elements, so that the lines are wrapped and don't overflow.
Results
Tested with haskell-language-server, rust-analyzer
Some language servers like (haskel-language-server, rust-analyzer) returns
MarkupContent { kind: "markdown", value: "..." }
for documentation. However when rendering it in Webkit it was wrapped in```markdown <contents> ```
one more time, confusing the JS libraryshowdown
.This PR
```markdown <contents> ```
wrapper whenMarkupContent.kind == "markdown"
white-space: pre-wrap
for<code>
elements, so that the lines are wrapped and don't overflow.Results
haskell-language-server, rust-analyzer
Before
Haskell
Rust
After
Haskell
Rust