Skip to content

Commit

Permalink
added boolean to the plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
renee-k committed Jul 6, 2024
1 parent 97f3b2b commit 9d0c2da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
PluginOptions as HtmlLikePluginOptions,
} from "./unified-latex-plugin-to-xml-like";

export type PluginOptions = HtmlLikePluginOptions & {};
export type PluginOptions = HtmlLikePluginOptions & {producePretextFragment: boolean};

/**
* Unified plugin to convert a `unified-latex` AST into a `xast` AST representation of PreTeXt source.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export type PluginOptions = {
* You probably want to use the function `htmlLike(...)` to return a node that gets converted to specific HTML.
*/
macroReplacements?: MacroReplacements;

producePretextFragment: boolean;
};

/**
Expand Down Expand Up @@ -126,6 +128,11 @@ export const unifiedLatexToXmlLike: Plugin<
}
});

if (!options.producePretextFragment) {

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

Check failure on line 131 in packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unhandled error

TypeError: Cannot read properties of undefined (reading 'producePretextFragment') ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-xml-like.ts:131:22 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 ❯ Object.run node_modules/trough/index.js:36:5 ❯ executor node_modules/unified/lib/index.js:321:20 ❯ Function.run node_modules/unified/lib/index.js:309:14 ❯ packages/unified-latex-to-pretext/libs/unified-latex-plugin-to-pretext.ts:26:55 ❯ wrapped node_modules/trough/index.js:115:27 ❯ next node_modules/trough/index.js:65:23 This error originated in "packages/unified-latex-to-pretext/tests/unified-latex-to-pretext.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
// Wrap in enough tags to ensure a valid pretext document
// ...
}

// Make sure we are actually mutating the current tree.
originalTree.content = tree.content;
};
Expand Down

0 comments on commit 9d0c2da

Please sign in to comment.