1
0
mirror of https://github.com/flarum/core.git synced 2025-07-21 16:51:34 +02: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:
Toby Zerner
2016-05-21 20:25:32 +09:30
parent 829f0e0275
commit edbc1164d1
4 changed files with 5 additions and 5 deletions

View File

@@ -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);
}