- Issue created by @Grevil
- last update
over 2 years ago 15 pass, 3 fail - @grevil opened merge request.
- last update
over 2 years ago 15 pass, 3 fail - ๐ฉ๐ชGermany Grevil
I added both Kernel and JS tests, to show the incorrect behavior!
Input:
<a class="test1 test2 test3 test4" href="mailto:example@mail.com"></a>Expected:
<a class="test1 test2 test3 test4" href="mailto:example@mail.com"></a>Actual:
<a class="test1 data-spamspan-test2 data-spamspan-test3 data-spamspan-test4 spamspan" href="mailto:example@mail.com">example@mail.com</a> - last update
over 2 years ago 6 pass, 4 fail - ๐ฉ๐ชGermany Anybody Porta Westfalica
@Grevil please also test other typical attributes, like id or rel for the a href.
At least add
id="test-id"
rel="noopener noreferrer"
please to all these tests, where it's not yet present.Other attributes might be untypical for mailto: links, but should also work technically. I don't think we have to test them.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a?retiredLocal... - ๐ฉ๐ชGermany Grevil
Yea this isn't working yet, really annoying, working on these strings instead of using a proper Crawler class
- ๐ฉ๐ชGermany Anybody Porta Westfalica
@Grevil please also test other typical attributes, like id or rel for the a href.
At least add
id="test-id"
rel="noopener noreferrer"
please to all these tests, where it's not yet present.Other attributes might be untypical for mailto: links, but should also work technically. I don't think we have to test them.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a?retiredLocal...The reason is the too simple split by a space. Attributes must be extracted more safely. We don't even have to touch their values :)
Input:
<a class="test1 test2 test3 test4" href="mailto:example@mail.com"></a>Expected (PHP Filter):
<a class="spamspan" data-class="test1 test2 test3 test4" href="mailto:example@mail.com"></a>Actual (PHP Filter):
<a class="spamspan" data-spamspan-class="test1 data-test2 data-test3 data-test4" href="mailto:example@mail.com"></a>Expected (JS / Finally):
<a class="test1 test2 test3 test4" href="mailto:example@mail.com"></a>Actual (JS / Finally):
<a class="test1 data-spamspan-test2 data-spamspan-test3 data-spamspan-test4 spamspan" href="mailto:example@mail.com">example@mail.com</a> - ๐ฉ๐ชGermany Grevil
As discussed, we should revert the explode changes and convert the attributes to "data-spamspan" attributes in processAsDom, using the DOMDocument / DOMElement classes, before running "replaceMailtoLinks".
And also add the other mentioned tests.
- last update
over 2 years ago 23 pass, 6 fail - last update
over 2 years ago 36 pass - Status changed to Needs review
over 2 years ago 3:19pm 20 July 2023 - ๐ฉ๐ชGermany Anybody Porta Westfalica
Coded this together with @Grevil and was harder than we thought due to the #%$&&$ยง Iterator on Dom nodes... I hope it's all fine now. And surely a lot better than using regex or explode. See https://blog.codinghorror.com/parsing-html-the-cthulhu-way/
Hopefully this part is DONE now :)
- ๐ฉ๐ชGermany Anybody Porta Westfalica
Thanks for the super fast review @joevagyok! :)
- Assigned to Grevil
- Status changed to Needs work
over 2 years ago 3:26pm 20 July 2023 - last update
over 2 years ago 36 pass - ๐ฉ๐ชGermany Grevil
Reworked "disableAttributes()" based on the comments provided, thanks for the review! Adding the remaining tests mentioned in #6 and #7.
- last update
over 2 years ago 38 pass, 1 fail - Issue was unassigned.
- Status changed to Needs review
over 2 years ago 7:40am 21 July 2023 - ๐ฉ๐ชGermany Grevil
Alright, added some final tests for this!
Also found out, that the parameters given to
assertSame()were in the wrong order (actual was expected, expected was actual).Final review pls!
- last update
over 2 years ago 39 pass - Status changed to RTBC
over 2 years ago 12:40pm 21 July 2023 - last update
over 2 years ago 39 pass -
joevagyok โ
committed e6bcc992 on 3.x authored by
Grevil โ
Issue #3375804 by Grevil, Anybody, joevagyok: Javascript not properly...
-
joevagyok โ
committed e6bcc992 on 3.x authored by
Grevil โ
- Status changed to Fixed
over 2 years ago 8:14am 25 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.