Files
gitea/web_src/js/modules/codeeditor/utils.test.ts
bircni ce8cf22af9 fix(actions): don't swallow HTML entities into linkified URLs (#38239)
In the Actions log viewer, a double-quoted URL renders with a stray
extra `;` after it.

Reported in `gitea/runner#1046`

Remove the buggy AI slop `linkifyURLs` and use new approach to process
URLs in text

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-06-28 19:37:16 +08:00

11 lines
440 B
TypeScript

import {findUrlAtPosition} from './utils.ts';
test('findUrlAtPosition', () => {
const doc = 'visit https://example.com for info';
expect(findUrlAtPosition(doc, 0)).toBeNull();
expect(findUrlAtPosition(doc, 6)).toEqual('https://example.com');
expect(findUrlAtPosition(doc, 15)).toEqual('https://example.com');
expect(findUrlAtPosition(doc, 24)).toEqual('https://example.com');
expect(findUrlAtPosition(doc, 25)).toBeNull();
});