Project

General

Profile

Actions

Bug #103698

closed

RTE does not allow empty attributes for the tag "a"

Added by Timo Webler 28 days ago. Updated 27 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2024-04-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The method \TYPO3\CMS\Core\Html\RteHtmlParser::TS_links_db remove all empty attributes from the tag "a".

This is needed to set the attribute download,. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download

Possible solution.

Index: sysext/core/Classes/Html/RteHtmlParser.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sysext/core/Classes/Html/RteHtmlParser.php b/sysext/core/Classes/Html/RteHtmlParser.php
--- a/sysext/core/Classes/Html/RteHtmlParser.php    
+++ b/sysext/core/Classes/Html/RteHtmlParser.php    (date 1713779033389)
@@ -356,7 +356,7 @@
                     $tagAttributes['href'] = $linkInformation['href'] ?? $tagAttributes['href'];
                 }

-                $blockSplit[$k] = '<a ' . GeneralUtility::implodeAttributes($tagAttributes, true) . '>'
+                $blockSplit[$k] = '<a ' . GeneralUtility::implodeAttributes($tagAttributes, true, true) . '>'
                     . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . '</a>';
             }
         }
Actions

Also available in: Atom PDF