mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00

Thanks to [marked JavaScript library](https://github.com/chjj/marked) by Christopher Jeffrey. The [style sheet](http://kevinburke.bitbucket.org/markdowncss/markdown.css) was created by Kevin Burke. Signed-off-by: Le Tan <tamlokveer@gmail.com>
33 lines
674 B
HTML
33 lines
674 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<meta charset="utf-8">
|
|
<head>
|
|
<link rel="stylesheet" type="text/css" href="markdown.css">
|
|
<script src="../utils/marked/marked.min.js"></script>
|
|
<script src="qwebchannel.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="placeholder"></div>
|
|
<script>
|
|
'use strict';
|
|
|
|
var placeholder = document.getElementById('placeholder');
|
|
|
|
var updateText = function(text) {
|
|
placeholder.innerHTML = marked(text);
|
|
}
|
|
|
|
new QWebChannel(qt.webChannelTransport,
|
|
function(channel) {
|
|
var content = channel.objects.content;
|
|
updateText(content.text);
|
|
content.textChanged.connect(updateText);
|
|
}
|
|
);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|