@bhsd/codemirror-mediawiki 3.10.1 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mwConfig.js CHANGED
@@ -161,7 +161,7 @@ var getMwConfig = async (modes) => {
161
161
  formatversion: 2
162
162
  });
163
163
  if (config && !isIPE) {
164
- const { functionSynonyms: [insensitive] } = config;
164
+ const [insensitive] = config.functionSynonyms;
165
165
  if (!("subst" in insensitive)) {
166
166
  cleanAliases(insensitive);
167
167
  Object.assign(insensitive, getConfig(magicwords, ({ name }) => others.has(name)));
package/dist/ref.js CHANGED
@@ -84,7 +84,7 @@ export default (articlePath) => (cm) => {
84
84
  const dom = elt('div', { class: selector.slice(1) });
85
85
  dom.style.font = getComputedStyle(view.contentDOM).font;
86
86
  if (ref) {
87
- const { range: { start, end } } = ref[0], anchor = posToIndex(doc, start), head = posToIndex(doc, end);
87
+ const { start, end } = ref[0].range, anchor = posToIndex(doc, start), head = posToIndex(doc, end);
88
88
  dom.innerHTML = highlightRef(state, state.sliceDoc(anchor, head));
89
89
  dom.addEventListener('click', () => {
90
90
  view.dispatch({
package/dist/token.js CHANGED
@@ -179,7 +179,7 @@ export const lookahead = (chars, comment) => {
179
179
  '-': String.raw `-(?!\{(?!\{))`,
180
180
  };
181
181
  if (typeof comment === 'object') {
182
- const { data: { tags } } = comment;
182
+ const { tags } = comment.data;
183
183
  table['<'] = String.raw `<(?!!--${tags.includes('onlyinclude') ? '|onlyinclude>' : ''}|(?:${tags.filter(tag => tag !== 'onlyinclude').join('|')})(?:[\s/>]|$))`;
184
184
  }
185
185
  return [...chars].map(ch => table[ch]).join('|');
@@ -994,7 +994,7 @@ let MediaWiki = (() => {
994
994
  return makeLocalTagStyle('list', state);
995
995
  }
996
996
  eatDoubleUnderscore(style, ch, stream, state) {
997
- const { config: { doubleUnderscore } } = this, underscore = ch.repeat(2), name = stream.match(doubleUnderscoreRegex[ch]);
997
+ const { doubleUnderscore } = this.config, underscore = ch.repeat(2), name = stream.match(doubleUnderscoreRegex[ch]);
998
998
  if (name) {
999
999
  if (Object.prototype.hasOwnProperty.call(doubleUnderscore[0], underscore + name[0].toLowerCase())
1000
1000
  || Object.prototype.hasOwnProperty.call(doubleUnderscore[1], underscore + name[0])) {
@@ -1283,7 +1283,7 @@ let MediaWiki = (() => {
1283
1283
  return makeLocalTagStyle('extTagBracket', state);
1284
1284
  }
1285
1285
  else if (stream.eat('>')) {
1286
- const { config: { tagModes } } = this;
1286
+ const { tagModes } = this.config;
1287
1287
  state.extName = name;
1288
1288
  state.extMode ||= name in tagModes && (tagModes[name]) in this
1289
1289
  && this[tagModes[name]]([
@@ -1421,7 +1421,7 @@ let MediaWiki = (() => {
1421
1421
  else if (delimiter !== ':') {
1422
1422
  ff = f.trim();
1423
1423
  }
1424
- const ffLower = ff.toLowerCase(), { config: { functionSynonyms, variableIDs, functionHooks } } = this, canonicalName = Object.prototype.hasOwnProperty.call(functionSynonyms[1], ff)
1424
+ const ffLower = ff.toLowerCase(), { functionSynonyms, variableIDs, functionHooks } = this.config, canonicalName = Object.prototype.hasOwnProperty.call(functionSynonyms[1], ff)
1425
1425
  && functionSynonyms[1][ff]
1426
1426
  || Object.prototype.hasOwnProperty.call(functionSynonyms[0], ffLower)
1427
1427
  && functionSynonyms[0][ffLower];
@@ -1488,7 +1488,7 @@ let MediaWiki = (() => {
1488
1488
  }
1489
1489
  const mt = stream.match(/^(?:[^::}{|<>[\]\s]|\s(?![::]))+/u);
1490
1490
  if (mt) {
1491
- const name = mt[0].trim().toLowerCase() + (stream.peek() === ':' ? ':' : ''), { config: { functionSynonyms: [insensitive] } } = this;
1491
+ const name = mt[0].trim().toLowerCase() + (stream.peek() === ':' ? ':' : ''), [insensitive] = this.config.functionSynonyms;
1492
1492
  if (name.startsWith('#')) {
1493
1493
  switch (insensitive[name] ?? insensitive[name.slice(1)]) {
1494
1494
  case 'invoke':