grammarkdown icon indicating copy to clipboard operation
grammarkdown copied to clipboard

HTML trivia tagName includes closing `>`

Open bakkot opened this issue 2 years ago • 0 comments

Repro:

'use strict';
let { CoreAsyncHost, Grammar, GrammarkdownEmitter } = require('grammarkdown');

let source = `
    Foo : <ins>Bar</ins>
`;

(async () => {
  const grammarHost = CoreAsyncHost.forFile(source);
  const grammar = new Grammar([grammarHost.file], {}, grammarHost);
  await grammar.bind();
  console.log(grammar.rootFiles[0].elements[0].body.leadingHtmlTrivia[0].tagName);
})().catch(e => {
  console.error(e);
  process.exit(1);
});

prints ins>. Note trailing >.

bakkot avatar May 18 '22 23:05 bakkot