Merge remote-tracking branch 'upstream/master'

* upstream/master:
  hyphenate long tokens in unreachableAMO message
  don't hook auxiliary CMs
This commit is contained in:
dana 2018-09-03 11:25:17 -07:00
commit 284f6d406c
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,9 @@ onDOMscriptReady('/codemirror.js').then(() => {
});
CodeMirror.defineInitHook(cm => {
if (!cm.display.wrapper.closest('#sections')) {
return;
}
if (prefs.get('editor.livePreview') && styleId) {
cm.on('changes', updatePreview);
}

View File

@ -129,7 +129,7 @@ function initPopup() {
$('label', info).textContent = t('unreachableAMO');
const note = (FIREFOX < 59 ? t('unreachableAMOHintOldFF') : t('unreachableAMOHint')) +
(FIREFOX < 60 ? '' : '\n' + t('unreachableAMOHintNewFF'));
const renderToken = s => s[0] === '<' ? $create('b', s.slice(1, -1)) : s;
const renderToken = s => s[0] === '<' ? $create('b', tWordBreak(s.slice(1, -1))) : s;
const renderLine = line => $create('p', line.split(/(<.*?>)/).map(renderToken));
const noteNode = $create('fragment', note.split('\n').map(renderLine));
const target = $('p', info);