[FIX] Match all occurrences of {static} / {attach}#3420
[FIX] Match all occurrences of {static} / {attach}#3420mart-e wants to merge 1 commit intogetpelican:mainfrom
{static} / {attach}#3420Conversation
|
Can you add a test? |
db84f84 to
817343b
Compare
|
@mart-e: There is a test failure, which needs to be addressed. If that test failure is due to the updated regex now actually correctly replacing the second |
|
@justinmayer no that test failure is the test I am adding, looks like my patch is actually not working/not enough. I have some troubles to invoke the test suit on my machine (probably some setup issues). |
|
Let's start with getting the tests running on your local workstation… What have you done so far, and what seems to be the problem with running the tests? |
If a markup element contains more than one {static} or {attach} value,
only the last one was replaced.
Simplify the regex to match every occurrence
Fixes getpelican#3419
817343b to
0177773
Compare
|
Looks like your test now passes. Bravo, Martin! Well done 👏 |
{static} / {attach}
|
Ok, I have figured out what was the issue, missing file declaration in my new test.
I used |
|
I do not believe there should be any cd ~/projects/pelican
fd --hidden --glob '*.orig' --exec trash(Above requires you have some kind of |
|
Oh you are right, much better when purging those files, I can run the tests now. Thanks a lot for your help 👍 As a sidenote, I am no longer the initial example with two attributes containing Or maybe somebody better than me in regex can find a way to achieve the same while still checking the starting |
If a markup element contains more than one {static} or {attach} value, only the last one was replaced.
Simplify the regex to match every occurrence.
This regex no longer checks for
<at the start which may imply false positive (to test if acceptable or not).Detail of the issue: #3419