All files / src/pipeline/parsing apply-markdown-it-extensions.js

100% Statements 3/3
0% Branches 0/1
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36                                        1x                     1x   4x    
'use strict';
 
/**
 * Markdown-it Extensions - Legacy Interface
 * 
 * This file provides backward compatibility for the refactored markdown-it extensions.
 * All the complex logic has been moved to specialized modules in the './markdown-it/' directory
 * for better maintainability and understanding.
 * 
 * The modular approach breaks down the functionality into:
 * - Table enhancements (Bootstrap styling, responsive wrappers)
 * - Template-tag syntax processing ([[def:term]], [[tref:spec,term]], etc.)
 * - Link enhancements (path-based attributes)
 * - Definition list processing (terminology vs references, term classification)
 * 
 * This refactoring reduces cognitive complexity and makes the code more approachable
 * for developers who are not familiar with the markdown-it library.
 */
 
// Import the new modular markdown-it extensions
const applyMarkdownItExtensions = require('../../markdown-it');
 
/**
 * Legacy interface function that maintains compatibility with existing code
 * 
 * @param {Object} md - The markdown-it instance to enhance
 * @param {Array} templates - Array of template-tag handler objects for custom syntax
 * 
 * This function simply delegates to the new modular system while maintaining
 * the same interface that consuming code expects.
 */
module.exports = function (md, templates = []) {
  // Apply all markdown-it enhancements using the new modular system
  applyMarkdownItExtensions(md, templates);
};