-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't break encoding of non-ISO-8859-1 data #12
Conversation
src/Component.php
Outdated
$entityLoaderDisabled = libxml_disable_entity_loader( true ); | ||
$internalErrors = libxml_use_internal_errors( true ); | ||
$document = new DOMDocument(); | ||
$document = new DOMDocument( null, 'UTF-8' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probalbly version "1.0" is the righter thing™ to do, albeit the outcome will be the same.
] | ||
} | ||
</script> | ||
<div id="result"> | ||
<!-- generated by `npm run-script populate-fixtures` --> | ||
<div class="lemma-widget"><ul class="lemma-widget_lemma-list"><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">lemma1</span> <span class="lemma-widget_lemma-language">en</span></li><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">lemma2</span> <span class="lemma-widget_lemma-language">fr</span></li></ul> <div class="lemma-widget_controls"><button type="button" class="lemma-widget_control">wikibase-edit</button> <!----> <!----></div></div> | ||
<div class="lemma-widget"><ul class="lemma-widget_lemma-list"><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">lemma1</span> <span class="lemma-widget_lemma-language">en</span></li><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">lémma2</span> <span class="lemma-widget_lemma-language">fr</span></li><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">기본형</span> <span class="lemma-widget_lemma-language">ko</span></li><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">Лемма</span> <span class="lemma-widget_lemma-language">ru</span></li><li class="lemma-widget_lemma"><span class="lemma-widget_lemma-value">لليما</span> <span class="lemma-widget_lemma-language">ar</span></li></ul> <div class="lemma-widget_controls"><button type="button" class="lemma-widget_control">wikibase-edit</button> <!----> <!----></div></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is really the outcome of npm run-script populate-fixtures
- and it contains html entities for characters that, in an UTF-8 world could be expressed without html entities. In the clients we do not want this to happen (right?!) so why do we have a test proving the opposite?
[ 'value' => '<p>한국어</p>' ] | ||
); | ||
|
||
assertThat( $result, is( equalTo( '<div><div><p>한국어</p></div></div>' ) ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite to the point of this bug, but we talked about is earlier... if v-html="value"
is not part of the rendered mark-up there is no way for client-side JS code to find the respective node for data binding. So what is really the benefit of having both mustache and the v-html way of interpolating variables?
As Vue rendering does not do it either. Makes for more clear expectations from the PHP renderer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to walk this through!
https://phabricator.wikimedia.org/T195359