luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
265 stars 19 forks source link

glitch in transpiler: text & links in tables #50

Closed emmanueltouzery closed 1 year ago

emmanueltouzery commented 1 year ago

I reduced an issue I noticed with openjdk-8 docs to this reproduction:

:= require'nvim-devdocs.transpiler'.html_to_md [[<table><tr><td><code><span class="memberNameLink"><a href="../../java/io/InputStream.html#available--">available</a></span>()</code><div>Returns</div></td></tr></table>]]

It outputs only:

| Returns |
| ------- |
{}

But I think it should include also the available link and the () text.

You can see the issue when comparing https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html

and the openjdk-8 InputStream display.

Part of the output is for instance:

## Methods

| Modifier and Type | Method and Description                                                                                                                                                            |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `int`             | Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |

But the method name should be next to the "Returns an estimate.." text.

emmanueltouzery commented 1 year ago

it's possible the same or very similar issue is also present in gtk-4.0 combobox: image

As you can see the function names are missing from the table.

luckasRanarison commented 1 year ago

I'm feeling really stupid right now. Here is the reason, I forgot to concatenate the string: 2023-09-14-210137_hyprshot

luckasRanarison commented 1 year ago

Thanks for the report! It should be fixed now.

luckasRanarison commented 1 year ago

Oh, I should add a linebreak after img. And I also noticed another bug

<table class="informaltable">  <tbody><tr> <td class="parameter_name"><p>model</p></td> <td class="parameter_description"><p>A <a href="gtktreemodel#GtkTreeModel-struct"><span class="type">GtkTreeModel</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table>

Gets converted to:

| model | A [GtkTreeModel](gtktreemodel#GtkTreeModel-struct). |  |
| ------- | ----------------------------------------------------- |  |

The columns are not even.

luckasRanarison commented 1 year ago

Fixed with 6b3225c and I've found an issue with glow lol, It doesn't apply the length of the original link to the table but use the formated one instead, example: [link] (link) but uses link /link

emmanueltouzery commented 1 year ago

thanks for the great work!