GitHub Flavored Markdown Test Suite Data

0.0.2 · maintenance · verified Sun Apr 19

The `gfm-test-suite` package, currently at version 0.0.2, provides a JavaScript representation of the GitHub Flavored Markdown (GFM) test suite. It specifically encapsulates the GFM Specification data (version 0.29-gfm, dated 2019-04-06) into a readily consumable JavaScript object. This utility allows developers to programmatically access official GFM test cases, which is invaluable for validating markdown parsers, testing rendering engines, or implementing GFM-compliant features. Its release cadence appears infrequent, with updates primarily addressing compatibility rather than introducing new features, indicating its role as a data-centric library. Its key differentiator is providing direct, structured access to this specific version of the GFM test data without requiring manual parsing of the specification document.

Warnings

Install

Imports

Quickstart

Demonstrates how to import the GFM test suite data and access its properties, including the version, date, and individual test cases.

import gfmTestSuite from 'gfm-test-suite';

console.log(`GFM Spec Version: ${gfmTestSuite.version}`);
console.log(`GFM Spec Date: ${gfmTestSuite.date}`);
console.log(`Total GFM Test Cases: ${gfmTestSuite.testCases.length}`);

// Example: Access the first test case
const firstCase = gfmTestSuite.testCases[0];
if (firstCase) {
  console.log('\n--- First Test Case ---');
  console.log('Section:', firstCase.section.trim());
  console.log('Example:', firstCase.example);
  console.log('Markdown Input:\n', firstCase.markdown.trim());
  console.log('Expected HTML Output:\n', firstCase.html.trim());
}

view raw JSON →