Commit Graph

181 Commits

Author SHA1 Message Date
Max Wu 3a5c6fa5ed feat: use svg for vega-lite renderer
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2020-02-27 18:20:41 +08:00
Max Wu 40a04f76f8 fix: catch viz.js render async error and recreate Viz instance
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2020-02-26 16:05:43 +08:00
Yukai Huang 59b31a108d
Remove unused markdown-it-emoji
use emoji markdown-it plugin implemented in 2063eb

Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2020-02-06 16:43:05 +08:00
Yukai Huang caf4ac61e5
Support emojify.css use cdn
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2020-02-06 14:31:25 +08:00
Yukai Huang 75ee5ad255
Merge branch 'develop' into feature/configurable-break-style 2019-11-01 10:27:47 +08:00
hoijui 558fa5fcf4 make standard conform [fix]
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-29 13:20:18 +01:00
hoijui aaf9466498 make `headerIds` `const` [fix]
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-29 11:57:51 +01:00
hoijui 9742f7d075 fix gfm header link generation with respect to `deduplicatedHeaderId`
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-29 10:00:22 +01:00
hoijui 905414d039 Make `id` block-scoped (thanks @Yukaii)
Co-Authored-By: Yukai Huang <yukaihuangtw@gmail.com>
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-22 17:14:02 +02:00
hoijui 34c2bfcfc5 Allow to generate lower case header references through the config (#1305)
This makes the references consistent/compatible with GitHub,
GitLab, Pandoc and many other tools.

This behavior can be enabled in config.json with:

```
"linkifyHeaderStyle": "gfm"
```

Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-21 22:17:55 +02:00
hoijui 9e4d07926a slight doc comment touch-up/simplification [minor]
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-21 22:17:55 +02:00
Yukai Huang fd155fa74d
Use defaultUseHardbreak config when render
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-10-20 14:30:56 +08:00
Yukai Huang 8d978cd2d0
Fix linting error
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-10-04 23:03:45 +08:00
Yukai Huang b2701caba7
Fix viz.js@2 api changes
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-10-04 22:33:23 +08:00
Max Wu df2c0e23b6
Merge pull request #1272 from hackmdio/bugfix/support-empty-spoiler
Support empty spoiler container syntax
2019-09-08 01:10:16 +08:00
Yukai Huang 1a85523ac9
Support empty spoiler container syntax
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-09-08 00:44:38 +08:00
Yukai Huang e73405b169
Install markdown-it-ruby
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-09-08 00:24:04 +08:00
Max Wu e89f820542
Feature/support vega lite (#1251)
Feature/support vega lite
2019-08-06 23:03:37 +08:00
Max Wu 71ea581796 Merge branch 'develop' into feature/support-vega-lite
# Conflicts:
#	package.json
#	public/views/slide.ejs
2019-08-06 22:06:43 +08:00
Max Wu 79e6d3d724 fix(security): potential JSONP callback overwritten
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2019-08-06 21:43:28 +08:00
BoHong Li ff124ab6bf
refactor: fix line after merged develop
Signed-off-by: BoHong Li <raccoon@hackmd.io>
2019-08-04 23:59:03 +08:00
BoHong Li 8ca8484992
refactor: fix lint on public/js/extra.js
Signed-off-by: BoHong Li <raccoon@hackmd.io>
2019-08-04 23:56:36 +08:00
Max Wu 49c6672b95 feat: add support of vega-lite
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2019-08-04 20:16:46 +08:00
Yukai Huang 6f7de25079
Make details element syncscrollable
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-08-03 19:20:44 +08:00
Yukai Huang 8d889a6736
Support "spoiler" container syntax
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
2019-08-03 14:43:16 +08:00
Chulki Lee 5ce981859e Render plantuml only in fence
Signed-off-by: Chulki Lee <chulki.lee@gmail.com>
2019-07-31 10:02:07 -07:00
Chulki Lee 1d7895c869 Add plantuml support
Signed-off-by: Chulki Lee <chulki.lee@gmail.com>
2019-07-31 10:02:07 -07:00
Max Wu dd267096c9 fix: use lodash escapeHTML
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2019-07-28 20:04:41 +08:00
Max Wu a7082633aa Upgrade mermaid to 8.2.3
to avoid XSS inside the svg tag

Signed-off-by: Max Wu <jackymaxj@gmail.com>
2019-07-28 20:04:41 +08:00
Max Wu fbb18b6e0a Fix stored XSS in the graphviz error message rendering [Security Issue]
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2019-04-14 12:12:02 -04:00
BoHong Li d387cac690
refactor: fix lint warning on public/js/extra.js
Signed-off-by: BoHong Li <a60814billy@gmail.com>
2019-04-12 18:00:25 +08:00
BoHong Li 67707d097f
fix: remove string.js for sucurity issue
1. Upgrade Imgur to fix npm install
2. Upgrade less version for security
3. Change package name in package.json to fit npm package.json rule

Signed-off-by: BoHong Li <a60814billy@gmail.com>
2019-04-12 18:00:22 +08:00
Sheogorath 982775f6dc
Fix broken HTML export with emojis
HTML export was broken due to missing alt-attribute for emojis.

This patch adds the old alt-element style and restores the exportability
this way.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-03-09 15:04:07 +01:00
Sheogorath c5ca7b634a
Remove broken speakerdeck embedding
The current speakerdeck implementation is broken. An alternative
implementation using oembed doesn't work due to CORS, which could be
solved by proxying the speakerdeck API, but we decided to not do this.

This patch provides the link to the speakerdeck presentation instead,
and this way doesn't break existing notes. This is right now the best
solution we could come up with.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-02-21 01:26:37 +01:00
Sheogorath d6dd33620c
Fix wrong anchors
While experimenting with the ToC changes, it became obvious that anchors
for those unnamed headers don't work.

This patch fixes those links by running the autolinkify twice and make
sure linkify only adds links to non-empty ids.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-19 20:20:56 +01:00
Sheogorath d188b3526a
Again: Replace emoji-plugin regex
The Regex introduced in the last commit[1], was already working quite
good. But still resulted in false positives for all URL that contained a
second `:`.

To fix this once and for all, we craft a simple, but long regex based on
all emoji names and use this to match them.

We could probably optimize it, but that should also be something the
regex engine itself can and should do.

[1]: 7e45533c75 (in this source tree)

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-31 15:33:45 +01:00
Sheogorath 7e45533c75
Fix emoji regex
The old regex, adapted from the other plugins, was a bit too open for
matching. This leads to matching something like: `This is a sentence:
[And something with a: in it.]()` which doesn't become a link anymore.
Because the match is: ` [And something with a`.

This patch provides a fix for the regex to only match non-space string
within the `:`'s.

References:
- Introducing commit:
2063eb8bdf
- Inspirational source of the original RegEx:
2063eb8bdf/public/js/extra.js (L1095)

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-29 20:37:47 +01:00
Christoph (Sheogorath) Kern e115423d12
Merge pull request #1006 from SISheogorath/fix/missingEmojis
Fix not rendered autocomplete emojis
2018-10-22 23:02:33 +02:00
Sheogorath 1d452a6ed4
Remove dead package octicon
Octicon no longer provides its CSS classes and this way is useless in
CodiMD. Replacing all used classes in the UI and remove it from build
system.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-10 23:42:41 +02:00
Sheogorath 2063eb8bdf
Fix not rendered autocomplete emojis
Currently we have some emojis that are autocompleted but won't show up
in the resulting document.

This patch adds all emojis that are pushed to Codemirror and applies
them to the markdown rendering process, so they become usable.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-10 21:24:33 +02:00
Sheogorath 75a23fe2c9
Add rel="noopener" to target="_blank" links
The noopener construct protects from some nasty clickjacking attacks. We
can apply them savely to all our links since we don't rely on the
previously used page.

Some more details: https://mathiasbynens.github.io/rel-noopener/

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-04 01:49:36 +02:00
Sheogorath 4b060c7dba
Rebrand HackMD to CodiMD
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24 13:24:12 +02:00
Max Wu a9c88ce248
Fix task todo might not toggle
which caused by not matching syntax with double dashes correctly
2018-01-24 00:10:52 +08:00
Wu Cheng-Han 3703b12584 Fix image alt not render properly 2018-01-19 00:53:49 +08:00
Max Wu 919b7467d4
Fix anchor id to keep uppercase characters
id shouldn’t be converted to lowercase since id attribute is case sensitive
2018-01-16 15:59:43 +08:00
Sheogorath e807f1b783
Fix mermaid error handling 2017-10-30 12:26:28 +01:00
Sheogorath 09d2ba41cf
Use mermaidAPI in mermaid scope
Introduced by a5b7145527 (diff-67ae90c5144c55348a3cbdb078240454L532)

Fixes #600

Parse only throws error: 167368d508 (diff-67ae90c5144c55348a3cbdb078240454)
2017-10-30 07:11:14 +01:00
Yukai Huang 60b86e0250 Fix markdown-it gist plugin code closing tag
fix #596
2017-10-21 11:45:17 +08:00
Wu Cheng-Han d96385eafd Fix to filter @import CSS syntax in style tag to prevent XSS [Security Issue] 2017-10-05 10:17:26 +08:00
Wu Cheng-Han b0b417cefc Fix unescape > symbol inside the style tags to make the CSS works 2017-10-05 09:59:57 +08:00