Discussion turns everything after a link into part of the link

Aperta Adatta ai principianti
#2,404 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Il pattern del link è urlMatcher in class-response.component.ts intorno alla riga 51; il suo gruppo di percorso (\/.*)? arriva fino alla fine della riga e lo schema è opzionale, quindi corrispondono anche parole semplici come "roots.water". Inizia leggendo quella regex e il codice che la applica al testo del post, poi riproduci con l'esempio nell'issue. Fatto quando il link si ferma allo spazio bianco, la punteggiatura finale è esclusa e la frase di esempio collega solo "example.com/page".

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When a Discussion post or reply contains a web address followed by more text on the same line, the rest of the line becomes part of the link.

How to reproduce

As a student, post "See example.com/page for the data, I think it is wrong." The whole of "example.com/page for the data, I think it is wrong." is one link, and clicking it opens a page that does not exist.

Cause

The path part of urlMatcher in class-response.component.ts (line 51) is (\/.*)?, which matches everything up to the end of the line. Two words joined by a period without a space, such as "roots.water", also become a link, since a scheme is optional and any 2 to 5 lowercase letters count as a top-level domain.

Possible fix

Limit the path to characters that cannot be whitespace, for example (\/[^\s<]*)?, and drop trailing punctuation from the match.

Lingua principale
TypeScript
Stelle
4
Fork
8
Merge medio
3g 8h
PR unite (30g)
12

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WISE-Community/WISE-Client

Tutte le issue di WISE-Community/WISE-Client

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.