typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.54k stars 56 forks source link

HTML Tables and Automator Actions #3857

Open hatlord opened 4 years ago

hatlord commented 4 years ago

Super edge case weirdo issue, so please bare with me while i try and explain this. I have an automator script that converts an HTML table to a Markdown table. In Typora, I can select the HTML table > right click > services > html_to_md and it converts. This works perfectly in textedit, chrome etc, but for some reason, when the contents of a <td> gets too long, it fails in Typora. When I perform the action in Typora, all that is sent to the action is a single dash (-) char, and not the HTML.

In order to replicate on mac, you need to brew install pandoc and then install the attached automator workflow.

html_table_to_markdown.zip

Some breaking HTML:

<table>
  <colgroup>
    <col width="20%">
    <col width="65%">
    <col width="15%">
  </colgroup>
  <thead>
    <tr><th>Issue</th>
      <th>Description</th>
      <th>Rating</th>
    </tr>
  </thead>
  <tbody>
    <tr><td>Issue one</td>
      <td>Some stuff goes here.</td>
      <td>More here</td>
    </tr>
    <tr><td>Issue Two</td>
      <td>Some stuff goes here.</td>
      <td>More here</td>
    </tr>
    <tr><td>Issue Three</td>
      <td>Some stuff goes here.</td>
      <td>More here</td>
    </tr>
    <tr><td>Issue Four</td>
      <td>Some stuff goes here.</td>
      <td>More here</td>
    </tr>
    <tr><td>Issue One</td>
      <td>Some stuff goes here.Some stuff goes here.Some stuff goes here.Some stuff goes here.Some stuff goes here.Some stuff goes here.Some stuff goes here.Some stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes hereSome stuff goes here</td>
      <td>More here</td>
    </tr>
  </tbody>
</table>

To be honest im at a bit of a loss to explain it given that the action works in other applications, so it must be something to do with the way that Typora is recognising that data, or handling it when it goes above a certain length.

Any help would be gratefully received! Thanks.

abnerlee commented 4 years ago

This seems a bug of Safari, I cannot get this workflow working on <textarea/> on https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_textarea using Safari

hatlord commented 4 years ago

I’m not sure how Safari is related? Is Typora using it under the hood?

abnerlee commented 4 years ago

Typora uss the system built-in webview engine on macOS, which is same with Safari