Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/transform/md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DefaultMarkdownIt from 'markdown-it';
import attrs from 'markdown-it-attrs';

import DefaultPlugins from './plugins';
import {preprocess} from './preprocessors';
import {log} from './log';
import makeHighlight from './highlight';
import extractTitle from './title';
Expand Down Expand Up @@ -60,7 +59,7 @@ function initMarkdownIt(options: OptionsType) {
initPlugins(md, options, pluginOptions);

// Init preprocessor and MD parser
const parse = initParser(md, options, env, pluginOptions);
const parse = initParser(md, options, env);

// Init render to HTML compiler
const compile = initCompiler(md, options, env);
Expand Down Expand Up @@ -116,12 +115,7 @@ function initPlugins(md: MarkdownIt, options: OptionsType, pluginOptions: Markdo
}
}

function initParser(
md: MarkdownIt,
options: OptionsType,
env: EnvType,
pluginOptions: MarkdownItPluginOpts,
) {
function initParser(md: MarkdownIt, options: OptionsType, env: EnvType) {
return (input: string) => {
const {
extractTitle: extractTitleOption,
Expand All @@ -130,9 +124,6 @@ function initParser(
getPublicPath,
} = options;

// Run preprocessor
input = preprocess(input, pluginOptions, options, md);

// Generate global href link
const href = getPublicPath ? getPublicPath(options) : '';

Expand Down
107 changes: 0 additions & 107 deletions src/transform/preprocessors/included/index.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/transform/preprocessors/index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/transform/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export interface OptionsType {
needFlatListHeadings?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
plugins?: ExtendedPluginWithCollect<any, any>[];
preprocessors?: MarkdownItPreprocessorCb[]; // Preprocessors should modify the input before passing it to MD
highlightLangs?: HighlightLangMap;
disableRules?: string[];
extractChangelogs?: boolean;
Expand All @@ -88,7 +87,7 @@ export interface OptionsType {
supportGithubAnchors?: boolean;
disableCommonAnchors?: boolean;
useCommonAnchorButtons?: boolean;
lang?: Lang;
lang?: string;
[x: string]: unknown;
}

Expand Down
4 changes: 0 additions & 4 deletions src/transform/utilsFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import QuickLRU from 'quick-lru';
import liquidSnippet from './liquid';
import {StateCore} from './typings';
import {defaultTransformLink} from './utils';
import {preprocess} from './preprocessors';

const filesCache = new QuickLRU<string, string>({maxSize: 1000});

Expand Down Expand Up @@ -83,9 +82,6 @@ export function getFileTokens(
sourceMap = liquidResult.sourceMap;
}

// Run preprocessor
content = preprocess(content, options);

if (!disableLint && lintMarkdown) {
lintMarkdown({
input: content,
Expand Down
7 changes: 1 addition & 6 deletions src/transform/yfmlint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import union from 'lodash/union';
import attrs from 'markdown-it-attrs';

import {LogLevels, Logger} from '../log';
import {preprocess} from '../preprocessors';

import baseDefaultLintConfig from './yfmlint';
import {
Expand All @@ -28,8 +27,7 @@ const defaultLintRules = [yfm001, yfm002, yfm003, yfm004, yfm005, yfm006, yfm007
const lintCache = new Set();

function yfmlint(opts: Options) {
let {input} = opts;
const {plugins: customPlugins, pluginOptions, customLintRules, sourceMap} = opts;
const {input, plugins: customPlugins, pluginOptions, customLintRules, sourceMap} = opts;
const {path = 'input', log} = pluginOptions;

pluginOptions.isLintRun = true;
Expand Down Expand Up @@ -61,9 +59,6 @@ function yfmlint(opts: Options) {
const plugins = customPlugins && [...(enableMarkdownAttrs ? [attrs] : []), ...customPlugins];
const preparedPlugins = plugins && plugins.map((plugin) => [plugin, pluginOptions]);

// Run preprocessor
input = preprocess(input, pluginOptions, opts);

let result;
try {
result = sync({
Expand Down
Loading