diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-02 10:36:11 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-02 10:36:11 +0900 |
| commit | 1f4ae2f63a609d51942daa23772439379496064e (patch) | |
| tree | 55e67e216bd30b8a5c95f769e8696c4b885d1e61 /src/mfm/from-html.ts | |
| parent | tweak avatar generation (diff) | |
| download | misskey-1f4ae2f63a609d51942daa23772439379496064e.tar.gz misskey-1f4ae2f63a609d51942daa23772439379496064e.tar.bz2 misskey-1f4ae2f63a609d51942daa23772439379496064e.zip | |
Use mfm-js for MFM parsing (#7415)
* wip
* Update mfm.ts
* wip
* update mfmjs
* refactor
* nanka
* Update mfm.ts
* Update to-html.ts
* Update to-html.ts
* wip
* fix test
* fix test
Diffstat (limited to '')
| -rw-r--r-- | src/mfm/from-html.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mfm/from-html.ts b/src/mfm/from-html.ts index 0b4f9b8945..4c8e2dbec8 100644 --- a/src/mfm/from-html.ts +++ b/src/mfm/from-html.ts @@ -1,7 +1,9 @@ import * as parse5 from 'parse5'; import treeAdapter = require('parse5/lib/tree-adapters/default'); import { URL } from 'url'; -import { urlRegex, urlRegexFull } from './prelude'; + +const urlRegex = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+/; +const urlRegexFull = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+$/; export function fromHtml(html: string, hashtagNames?: string[]): string { const dom = parse5.parseFragment(html); |