Fix comment tag values

This commit is contained in:
Jon Staab
2025-04-29 09:18:34 -07:00
parent 8ce0abbccd
commit ed10a620a7
5 changed files with 21 additions and 4 deletions
+1 -2
View File
@@ -235,8 +235,7 @@ export const parseInvoice = (text: string, context: ParseContext): ParsedInvoice
export const parseLink = (text: string, context: ParseContext): ParsedLink | void => {
const prev = last(context.results)
const [link] =
text.match(/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi) || []
let link = text.match(/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi)?.[0]
// Skip url if it's just the end of a filepath or an ellipse
if (!link || (prev?.type === ParsedType.Text && prev.value.endsWith("/")) || link.match(/\.\./)) {