mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-05 00:06:29 +00:00
Enable more markdown paste features in textarea editor (#35494)
Enable the [same paste features](https://github.com/github/paste-markdown#paste-markdown-objects) that GitHub has, notably the ability to paste text containing HTML links and have them automatically turn into Markdown links. As far as I can tell, previous paste features all work as expected. --------- Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
import {pathEscapeSegments, isUrl, toOriginUrl} from './url.ts';
|
||||
import {pathEscapeSegments, toOriginUrl} from './url.ts';
|
||||
|
||||
test('pathEscapeSegments', () => {
|
||||
expect(pathEscapeSegments('a/b/c')).toEqual('a/b/c');
|
||||
expect(pathEscapeSegments('a/b/ c')).toEqual('a/b/%20c');
|
||||
});
|
||||
|
||||
test('isUrl', () => {
|
||||
expect(isUrl('https://example.com')).toEqual(true);
|
||||
expect(isUrl('https://example.com/')).toEqual(true);
|
||||
expect(isUrl('https://example.com/index.html')).toEqual(true);
|
||||
expect(isUrl('/index.html')).toEqual(false);
|
||||
});
|
||||
|
||||
test('toOriginUrl', () => {
|
||||
const oldLocation = String(window.location);
|
||||
for (const origin of ['https://example.com', 'https://example.com:3000']) {
|
||||
|
Reference in New Issue
Block a user