Comments (3)
Custom Click Handler is now avaliable in v0.3.0
A simple demo can be found here http://laobubu.net/HyperMD/?directOpen#./docs/index.md
...or just put this into your js...
cm.setOption("hmdClick", clickHandler)
function clickHandler(info, cm) {
if (info.type === "link" || info.type === "url") {
var url = info.url
if ((info.ctrlKey || info.altKey) && /hotdog/i.test(url)) {
alert("You can't access urls containing HotDog")
return false
}
}
}
from hypermd.
I noticed that clicking on link (not the icon) is actually in the click addon - would be nice to have similar option for a click() handler there as well (or maybe refactor part of click addon into fold addon or vice versa?)
from hypermd.
Yes. the click handler will be introduced in next version (TypeScript ver). Click add-on only works when user clicks on text, not image. If you want to handle events on images, try adding a capturing (not bubbling) event listener.
from hypermd.
Related Issues (20)
- Non-techie mode? HOT 1
- 关于主题和代码高亮
- 请问如何编译 import 的其他包的内容 HOT 2
- flow 左右分屏容易改造吗?
- Supporting syntax highlight for code block HOT 4
- :::info:::,
- Repo Active
- Cannot convert from `GLib.List<Gtk.Window>' to `GLib.List<weak Gtk.Window> HOT 1
- 官方能出VScode或者Nextcloud这种私有云的插件吗?
- How to import this as ES Module? HOT 2
- Not Highlighting code blocks in vue HOT 1
- Cant seem to get it working, always producing error
- The text box is wobbling badly
- The demo address cannot be opened HOT 1
- Hypermd syntax highlighter stops working inside a code block (Obsidian's Admonition-plugin, CodeMirror) HOT 1
- How to disable folding
- Demo site is down
- 文档和测试站点宕机了
- CodeMirror 6
- Working on a fork supporting CodeMirror 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hypermd.