<commit_before>import { expect } from 'chai'
import Up from '../../index'


context("You can produce HTML directly from markup!", () => {
  specify('If you provide the toHtml method with markup, it internally calls the toDocument method for you using configuration you provide.', () => {
    const markup = `
Anyway, let us get to the point.

I enjoy apples
==============

LOOK AWAY
  After beating the Elite Four, Blue steals a Red Delicious from Red.`

    const html = Up.toHtml(markup, {
      createTableOfContents: true,
      createSourceMap: true,
      terms: {
        spoiler: 'LOOK AWAY',
        tableOfContents: 'In This Article'
      }
    })

    expect(html).to.be.eql(
      '<nav class="up-table-of-contents">'
      + '<h1>In This Article</h1>'
      + '<ul>'
      + '<li><h2><a href="#up-item-1">I enjoy apples</a></h2></li>'
      + '</ul>'
      + '</nav>'
      + '<p data-up-source-line="2">Anyway, let us get to the point.</p>'
      + '<h1 data-up-source-line="4" id="up-item-1">I enjoy apples</h1>'
      + '<div class="up-spoiler up-revealable" data-up-source-line="7">'
      + '<label for="up-spoiler-1">toggle spoiler</label>'
      + '<input id="up-spoiler-1" type="checkbox">'
      + '<div>'
      + '<p data-up-source-line="8">After beating the Elite Four, Blue steals a Red Delicious from Red.</p>'
      + '</div>'
      + '</div>')
  })<commit_msg>Add failing inline document HTML test<commit_after>import { expect } from 'chai'
import Up from '../../index'


context("You can produce HTML directly from markup!", () => {
  specify('If you provide the toHtml method with markup, it (internally) calls the toDocument method for you using configuration you provide.', () => {
    const markup = `
Anyway, let us get to the point.

I enjoy apples
==============

LOOK AWAY
  After beating the Elite Four, Blue steals a Red Delicious from Red.`

    const html = Up.toHtml(markup, {
      createTableOfContents: true,
      createSourceMap: true,
      terms: {
        spoiler: 'LOOK AWAY',
        tableOfContents: 'In This Article'
      }
    })

    expect(html).to.be.eql(
      '<nav class="up-table-of-contents">'
      + '<h1>In This Article</h1>'
      + '<ul>'
      + '<li><h2><a href="#up-item-1">I enjoy apples</a></h2></li>'
      + '</ul>'
      + '</nav>'
      + '<p data-up-source-line="2">Anyway, let us get to the point.</p>'
      + '<h1 data-up-source-line="4" id="up-item-1">I enjoy apples</h1>'
      + '<div class="up-spoiler up-revealable" data-up-source-line="7">'
      + '<label for="up-spoiler-1">toggle spoiler</label>'
      + '<input id="up-spoiler-1" type="checkbox">'
      + '<div>'
      + '<p data-up-source-line="8">After beating the Elite Four, Blue steals a Red Delicious from Red.</p>'
      + '</div>'
      + '</div>')
  })

  specify('If you provide the toInlineHtml method with markup, it (internally) calls the toInlineDocument method for you using configuration you provide.', () => {
    const markup = `After beating the Elite Four, [LOOK AWAY: Blue steals a Red Delicious from Red.]`

    const html = Up.toInlineHtml(markup, {
      documentName: 'reply 104',
      terms: {
        spoiler: 'LOOK AWAY',
      }
    })

    expect(html).to.be.eql(
      'After beating the Elite Four, '
      + '<span class="up-spoiler up-revealable">'
      + '<label for="reply-104-spoiler-1">toggle spoiler</label>'
      + '<input id="reply-104-spoiler-1" type="checkbox">'
      + '<span>'
      + '<p data-up-source-line="8">After beating the Elite Four, Blue steals a Red Delicious from Red.</p>'
      + '</span>'
      + '</span>')
  })
{'fraction_non_alphanumeric': 0.1756420878210439, 'fraction_numerical': 0.011046672190002762, 'mean_word_length': 2.788702928870293, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2246329', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1182, 'n_words': 338}