In the Joomla! backend go to "Extensions > Language(s) > Overrides", and click on "New" to create a new override. Into the field labeled "Language Constant" enter
TEST_CONSTANT
Into the field labeled "Text" enter the following HTML markup code which includes a valid attribute:
<span data-type="abc">A</span>
Click on "Save".
<span data-type="abc">A</span>
<span datatype="abc">A</span>
Mind: datatype
as opposed to the originally entered data-type
with a hyphen.
Joomla! 3.8.8
The hyphen is silently stripped from the attribute name. As far as I can see this is wrong and should be fixed.
I think it is important to mention that the hyphen in a class name — or elsewhere in the text — is not stripped. The following is left untouched when the override is saved:
<span class="my-class">A</span>
Similar for plain text:
Swimming-Pool
Whatever "corrects" the value does not just strip hyphens but seems to make a distinction between HTML attribute names and other strings.
According to the W3C documentation a hyphen in an HTML attribute name is valid:
https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#embedding-custom-non-visible-data-with-the-data-attributes
So a "syntax correction" — if that is what happens here — would not be appropriate.
(As a workaround the text can be entered manually into the *.ini file, of course.)
Labels |
Added:
?
|
Category | ⇒ | com_languages |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-06-26 11:23:09 |
Closed_By | ⇒ | mbabker |
Yes. The filtering library handles all input filtering and sanitization, regardless of whether you're editing a language override or an article.
That setting applies to how text in WYSIWYG editor fields (such as article editing) is filtered. There are still other code paths that will result in input being filtered and sanitized separate from that setting. In your case, the issue was because of a general bug in the filtering library.
OK, thank you very much for the explanation. :-)
Duplicate of #20579