Skip to content

Commit

Permalink
Revert "Fix truncated path links in push notifications (#3077)"
Browse files Browse the repository at this point in the history
This reverts commit a35bdc0.
  • Loading branch information
hannaseithe committed Feb 17, 2025
1 parent 0b1cfa1 commit 280bb34
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.

This file was deleted.

5 changes: 0 additions & 5 deletions shared/utils/__tests__/replaceLinks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ describe('replaceLinks', () => {
expect(replace).toHaveBeenCalledTimes(1)
expect(replace).toHaveReturnedWith('https://integreat.app/asdf')
})
it('should match "_2025.pdf"', () => {
replaceLinks('some content https://bildung-test.de/fileadmin/media/pdf/test_2024.pdf', replace)
expect(replace).toHaveBeenCalledTimes(1)
expect(replace).toHaveReturnedWith('https://bildung-test.de/fileadmin/media/pdf/test_2024.pdf')
})

it('should match arabic non-ASCII chars in pathname, query and hash', () => {
replaceLinks(
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/replaceLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const unicode = 'a-zA-Z0-9\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF'
const protocol = /([A-Za-z]{3,9}:(?:\/\/)?)/
const hostname = /(?:[-;:&=+$,\w]+@)?([A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*)/
// language=RegExp
const path = `(?:\\/(?:[+~%/_.${unicode}-]*[+~%/${unicode}-]+)?)?`
const path = `(?:\\/(?:[+~%/.${unicode}-]*[+~%/${unicode}-]+)?)?`
// language=RegExp
const query = `(?:\\?([-+=&;%@.${unicode}]*[-+=&;%@${unicode}]+)?)?`
// language=RegExp
Expand Down

0 comments on commit 280bb34

Please sign in to comment.