[TASK] Extract broken links marker syntax for RTE
The RTE parser has the following functionality: - When transforming content from DB to RTE, and <link 13> tag references a page that does not exist anymore, it adds an attribute rteerror="Page 13 does not exist" and style="background-color: yellow; border:2px red solid; color: black;" to the then rendered <a> tag. - When coming back from the RTE to the DB, the <a> tags that do not contain a "rteerror" attribute but a style attribute are wrapped in a <span> tag before transforming back to a <link> tag, since the custom <link> tag cannot contain any other property than href, class, target and title. - If both "rteerror" and "style" attributes are still set, they get removed again. This approach has several downsides: - Due to the limitation of the <link> tag an additional <span> tag gets added to the database (!) which adds hard-coded styling. The only way to remove this is to disallow "style" attributes in "span" tags, or to manually remove the span tags from the database. - The transformation is not 1:1 the same / are not in sync. So, if the editor changes the page ID of the broken link from "13" to any other existing page, the span tag with the yellow background is still added and kept. - If the target page 13 gets added back via the recycler, the span tag needs to be removed from the RTE content again manually (in source code mode of the RTE) Instead, the functionality to display broken links is now handled differently: - A new transformation "detectbrokenlinks" is added to the RTE parser which checks all <a> tags with the new link service class (thus, checks for all ! links not just <link> tags) - The added attributes which are added to the <a> tag is removed again (regardless if the link was fixed or not) when saving the data again in the RTE thus leaving no ugly hard-coded tags when rendering the content in the frontend, making sure that content is clean in the database. - The frontend is now only throwing a TS log message for the admin panel (as before), and this should be the way to handle broken links in the future. Resolves: #79267 Releases: master Change-Id: I8d0979fe9694d278a3e642a33e66f5decfb46bd8 Reviewed-on: https://review.typo3.org/51258 Reviewed-by:Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
TYPO3com <no-reply@typo3.com> Reviewed-by:
Susanne Moog <susanne.moog@typo3.org> Tested-by:
Susanne Moog <susanne.moog@typo3.org>
Please register or sign in to comment