Welcome to mirror list, hosted at ThFree Co, Russian Federation.

description_list.js « nodes « markdown « behaviors « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c5305c484239b7ce025f33d3141b63564816f792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Transforms generated HTML back to GFM for Banzai::Filter::MarkdownFilter
export default () => ({
  name: 'description_list',
  schema: {
    content: '(description_term+ description_details+)+',
    group: 'block',
    parseDOM: [{ tag: 'dl' }],
    toDOM: () => ['dl', 0],
  },

  toMarkdown(state, node) {
    state.write('<dl>\n');
    state.wrapBlock('  ', null, node, () => state.renderContent(node));
    state.flushClose(1);
    state.ensureNewLine();
    state.write('</dl>');
    state.closeBlock(node);
  },
});