mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 07:09:57 +08:00
Automatically support basic HTML tags in translations
This allows front-end translations to use basic (attributeless) HTML tags freely, without the need for the translator call to supply a matching vdom element. Translations can thus make use of styling (<em>, <code>, etc.) as they see fit. The translator call can still optionally supply a vdom element to substitute in more complex tags where necessary (e.g. hyperlinks). /cc @dcsjapan
This commit is contained in:
@ -74,7 +74,7 @@ export default class Translator {
|
||||
if (match[2]) {
|
||||
open.shift();
|
||||
} else {
|
||||
let tag = input[match[3]] || [];
|
||||
let tag = input[match[3]] || {tag: match[3], children: []};
|
||||
open[0].push(tag);
|
||||
open.unshift(tag.children || tag);
|
||||
}
|
||||
|
Reference in New Issue
Block a user