Autoconversion to Markdown while pasting html #1530
markomitranic
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
Becomes: HTML tables allow web developers to arrange data into rows and columns.
* * * * *
### Example
| Company | Contact | Country |
| Alfreds Futterkiste | Maria Anders | Germany |
| Centro comercial Moctezuma | Francisco Chang | Mexico |
| Ernst Handel | Roland Mendel | Austria |
| Island Trading | Helen Bennett | UK |
| Laughing Bacchus Winecellars | Yoshi Tannamuri | Canada |
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
[Try it Yourself »](https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_intro)
* * * * * |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @markomitranic! This is interesting... how would we actually know that the user is pasting HTML? Would we have to "sniff" it? Also remember that people may want to actually paste HTML (because Markdown supports so) and therefore it may be hard to disambiguate between the two. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey gang,
Here's an idea... I was whipping away at some old Advent of Code challenges, and came across a possible UX improvement for us. It would be pretty cool to be able to paste stuff from the browser, GitHub, some docs, or even Slack, into a markdown cell, and have it automagically, properly converted into markdown. Or a button that "pastes with formatting".
Here is a website I used to achieve this while copying stuff from AoC website: https://euangoddard.github.io/clipboard2markdown/
The implementation seems to be just a fairly simple JS script. I could probably also figure out how to do it on the elixir side, if we don't want to add more random JS stuff into people's browsers :P
Example:
Once such text is copy/pasted into a markdown cell, it becomes pure plain text:
On the other hand, if it copy/paste it into the abovementioned website, and then into Livebook, we get to keep all the formatting, anchors, headings and even embedded media like images or tables with data in them, we see:
wdyt?
Beta Was this translation helpful? Give feedback.
All reactions