csbun / atom-markclip Goto Github PK
View Code? Open in Web Editor NEWAn Atom package to insert image form clipboard into markdown file
License: MIT License
An Atom package to insert image form clipboard into markdown file
License: MIT License
Uncaught TypeError is occurred when I paste image in markdown file.
Environments is below.
Stack trace is below.
TypeError: img.toDataUrl is not a function
at Object.handleCtrlVEvent (/Users/imagepit/.atom/packages/markclip/lib/markclip.coffee:60:51)
at /Users/imagepit/.atom/packages/markclip/lib/markclip.coffee:77:10
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/node_modules/event-kit/lib/emitter.js:125:28)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:389:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:106:36)
at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:59)
Please help me.
I use markdown-preview-plus which uses markdown-it to render markdown. markdown-it conforms to commonmark and requires paths with special characters to be escaped or the whole path surrounded in angle brackets, as seen here. When the name of the file I am pasting into with atom-markclip itself has a space then the folder created for the image has a space and it is not rendered properly. Can an option be added to surround a path in angle brackets if the path contains spaces or any other special character?
[Enter steps to reproduce:]
file in folder
Atom: 1.28.0 x64
Electron: 2.0.3
OS: Mac OS X 10.13.5
Thrown From: markclip package 0.4.0
Uncaught TypeError: img.toPng is not a function
At /Users/nornorthpoint77/.atom/packages/markclip/lib/markclip.coffee:75
TypeError: img.toPng is not a function
at Object.handleInsertEvent (/packages/markclip/lib/markclip.coffee:75:41)
at /packages/markclip/lib/markclip.coffee:99:34)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:110:40)
-8:39.2.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
3x -5:03.1.0 core:cancel (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
-3:10.8.0 markclip:insert (input.hidden-input)
-2:58.9.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
-0:01.8.0 markclip:insert (input.hidden-input)
atom-beautify 0.32.4
atom-csv-markdown 1.0.2
atom-runner 2.7.1
atomic-emacs 0.12.1
autocomplete-paths 2.12.2
autocomplete-python 1.10.5
browser-plus 0.0.98
busy-signal 1.4.3
convert-to-utf8 0.2.4
date 2.1.0
document-outline 2.0.1
ex-mode 0.18.0
file-icons 2.1.16
git-plus 7.10.2
highlight-selected 0.13.1
hyperclick 0.1.5
intentions 1.1.5
japanese-menu 1.14.0
japanese-word-selection 0.5.1
language-powershell 4.0.1
linter 2.2.0
linter-flake8 2.3.0
linter-ui-default 1.7.1
markclip 0.4.0
markdown-pdf 2.2.0
markdown-preview-plus 3.3.0
markdown-table-editor 1.0.2
markdown-toc 0.4.2
markdown-writer 2.7.3
minimap 4.29.8
project-manager 3.3.5
python-indent 1.1.4
show-ideographic-space 1.0.2
split-diff 1.5.2
Sublime-Style-Column-Selection 1.7.4
tidy-markdown 3.0.1
tool-bar 1.1.4
tool-bar-markdown-writer 0.3.1
vim-mode-plus 1.27.0
wordcount 2.10.4
I did not see it anywhere in settings, but is it possible to change the folder separators i.e backslash or forwardslash? Windows is stuck with a different choice from Macs/Linux/Unix. All the paths to the right folder are wrong for me. It is trivial for me to fix each time, if I remember... but I am forgetful, so lots of tiny little mistakes left behind. Sorry if I missed something. Thanks!
markdown-img-paste 这个插件在 windows 下粘贴的图片正常,
但是在 mac pro 下,粘贴图片始终是截图尺寸的 2 倍
command-c
to copy itcommand-shift-f
to open the "Find in project" search formcommand-v
to paste text into the search fieldcommand-shift-f
to focus the "Find in project" search formcommand-v
to paste text into the search field, nothing happensI find that creating filename with hashes make reusing the images hard.
It would be great if we had the following additional options in addition to Save Type:
prompt for name
would ask to choose a filename after pasting.prompt for location
would ask to choose a folder name after pasting.There could also be a option to set the default image save path. (either from the root folder or relative to the current file).
Cheers!
Jun
I use this extension a lot for notes, and often take screenshots to embed in the notes themselves. I currently use the file in folder
setting and It can be kind of a pain to refactor notes and have to worry about going back into the images folder and deleting the unused images.
Would it be possible to add a feature to go through and remove unused images from the images folder? Get the list of files in the folder that would correspond to this markdown document, get the list of images referenced in the document, take the diff and prompt for deletion. I don't see an obvious reason to have anything other than a simple dialog with a list of the images to be deleted and asking for confirmation, but others may have different requirements. For user comfort, it could also mention the number of images that were found in the images folder that are used in the current document, just so people can see the correct folder was selected.
I could see this going in either the context menu for a document tab, or available from Packages > Markclip.
Propose adding support for LaTeX documents. Just as ctrl+v
in the Markdown grammars produces something like ![][image-filename.png]
, could have the action produce something like:
\begin{figure}
\caption{Optional caption that could be set in modal or defaulted or unused}
\centering
\includegraphics[width=0.5\textwidth]{image-filename}
\end{figure}
文中引用语法:
![avatar][doge]
文末存储字符串语法:
[doge]:data:image/png;base64,iVBORw0......
Base64编码很长,放在正文太影响阅读,所以放在末尾最好
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.