Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad markdown table format in docs preview (<space-k>) #11175

Open
HairlessVillager opened this issue Jul 15, 2024 · 1 comment · May be fixed by #12693
Open

Bad markdown table format in docs preview (<space-k>) #11175

HairlessVillager opened this issue Jul 15, 2024 · 1 comment · May be fixed by #12693
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR

Comments

@HairlessVillager
Copy link

Summary

image

Reproduction Steps

Here is a reproduction steps:

  1. open a Rust source code file and write:
fn main() {}

///
/// # H1
///
/// ## H2
///
/// ### H3
///
/// **bold text**
///
/// *italicized text*
///
/// > blockquote
///
/// 1. First item
/// 2. Second item
/// 3. Third item
///
/// - First item
/// - Second item
/// - Third item
///
/// `code`
///
/// ---
///
/// [title](https://www.example.com)
///
/// ![alt text](image.jpg)
fn foo() {}

/// | Syntax    | Description |
/// | --------- | ----------- |
/// | Header    | Title       |
/// | Paragraph | Text        |
///
/// ```
/// {
///   "firstName": "John",
///   "lastName": "Smith",
///   "age": 25
/// }
/// ```
///
/// Here's a sentence with a footnote. [^1]
///
/// [^1]: This is the footnote.
///
/// ### My Great Heading {#custom-id}
///
/// term
/// : definition
///
/// ~~The world is flat.~~
///
/// - [x] Write the press release
/// - [ ] Update the website
/// - [ ] Contact the media
///
/// That is so funny! :joy:
///
/// I need to highlight these ==very important words==.
///
/// H~2~O
///
/// X^2^
fn bar() {}
  1. ensure the lsp is running
  2. move to the foo in line 68, and press space bar then the key k
  3. the popup will looks like:
    image

Expect it looks like:
image

Helix log

~/.cache/helix/helix.log
2024-07-15T13:53:33.147 helix_lsp::transport [INFO] rust-analyzer -> {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":5,"line":67},"textDocument":{"uri":"file:///E:/code/rust/trpl/trial/src/main.rs"}},"id":1}
2024-07-15T13:53:33.150 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-07-15T13:53:33.156 helix_lsp::transport [INFO] rust-analyzer <- {"jsonrpc":"2.0","id":1,"result":{"contents":{"kind":"markdown","value":"\n```rust\ntrial\n```\n\n```rust\nfn bar()\n```\n\n---\n\n|Syntax|Description|\n|------|-----------|\n|Header|Title|\n|Paragraph|Text|\n\n```rust\n{\n  \"firstName\": \"John\",\n  \"lastName\": \"Smith\",\n  \"age\": 25\n}\n```\n\nHere's a sentence with a footnote. [^1]\n\n[^1]: This is the footnote.\n\n### My Great Heading {#custom-id}\n\nterm\n: definition\n\n~~The world is flat.~~\n\n* [x] Write the press release\n* [ ] Update the website\n* [ ] Contact the media\n\nThat is so funny! :joy:\n\nI need to highlight these ==very important words==.\n\nH~2~O\n\nX^2^"},"range":{"start":{"line":67,"character":3},"end":{"line":67,"character":6}}}}
2024-07-15T13:53:33.156 helix_lsp::transport [INFO] rust-analyzer <- {"contents":{"kind":"markdown","value":"\n```rust\ntrial\n```\n\n```rust\nfn bar()\n```\n\n---\n\n|Syntax|Description|\n|------|-----------|\n|Header|Title|\n|Paragraph|Text|\n\n```rust\n{\n  \"firstName\": \"John\",\n  \"lastName\": \"Smith\",\n  \"age\": 25\n}\n```\n\nHere's a sentence with a footnote. [^1]\n\n[^1]: This is the footnote.\n\n### My Great Heading {#custom-id}\n\nterm\n: definition\n\n~~The world is flat.~~\n\n* [x] Write the press release\n* [ ] Update the website\n* [ ] Contact the media\n\nThat is so funny! :joy:\n\nI need to highlight these ==very important words==.\n\nH~2~O\n\nX^2^"},"range":{"end":{"character":6,"line":67},"start":{"character":3,"line":67}}}

Platform

Windows 10

Terminal Emulator

Windows Terminal Version: 1.20.11781.0

Installation Method

releases page

Helix Version

helix 24.3 (2cadec0)

@HairlessVillager HairlessVillager added the C-bug Category: This is a bug label Jul 15, 2024
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jul 20, 2024
@pascalkuthe
Copy link
Member

we don't really render tables at all. We need to add handle the table tag in the markdown UI component

@pascalkuthe pascalkuthe added the E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR label Jul 25, 2024
@rmehri01 rmehri01 linked a pull request Jan 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants