Table to Markdown Copier Enhanced Version

Convert html table to markdown format and copy it to clipboard

作者
Bryan “Ironman” Stark
今日安裝
0
安裝總數
13
評價
0 0 0
版本
2.1.0
建立日期
2023-12-18
更新日期
2023-12-18
授權條款
MIT
腳本執行於
所有網站

Table to Markdown Copier - Enhanced Version


Table to Markdown Copier - Enhanced Version


This enhanced version of the "Table to Markdown Copier" UserScript
introduces significant improvements for ease of use and performance,
including a transition to vanilla JavaScript and a streamlined activation
method.

Du Dang's Original Script


The original UserScript can be found at
Greasy Fork, version 1.0.1.

Du Dang's Original Git Hub Repo


https://github.com/hotmit/table-markdown-userscript

Why Make Changes?


When I first tried Du Dang's script, I thought it was great but had some
trouble with the keyboard shortcut of Shift+Shift+T. When looking at the
code, I realized there were a few things that could be enhanced for a
slightly better user experience.

Changes in the Enhanced Version


  • Transition to Vanilla JavaScript: Replaced jQuery-based
    code with vanilla JavaScript to enhance performance and reduce
    dependencies.

  • Clipboard API Integration: Replaced ClipboardJS with
    the native Clipboard API for copying text to the clipboard.

  • Activation Method: The script is now activated via the
    Tampermonkey menu or the UserScript manager menu, eliminating reliance
    on keyboard shortcuts. This change makes the script more accessible and
    user-friendly as some users may already have the keyboard shortcuts
    assigned to other functions as I did.

  • Comments Removal: Removed all comments from the script
    for cleaner and more efficient code.

  • Metadata Update: Updated the script's metadata,
    including the version number to 2.1.0, and authorship to reflect the new
    maintainer while crediting the original creator.

Using the Enhanced Script


To activate the script, select the "Convert Table to Markdown" option from
the Tampermonkey menu or your UserScript manager menu. This action will
add a purple-colored "MD" button to the top right cell of each table on
the page. Clicking this button will convert the table to Markdown format
and copy it to your clipboard.

Test the Script


Users can test the script on the following webpage:
W3Schools HTML Tables. This page contains several tables that the script can process.

License

MIT License