Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Require fbmarkdown 1.6.5, set flags required for permissive behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jan 20, 2021
1 parent 825b315 commit ff89604
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"hhvm": "^4.80",
"hhvm/hsl": "^4.0",
"hhvm/hsl-experimental": "^4.53",
"facebook/fbmarkdown": "^1.0",
"facebook/fbmarkdown": "^1.6.5",
"facebook/hh-clilib": "^2.1.0",
"facebook/definition-finder": "^2.13.0",
"hhvm/hhast": "^4.80",
Expand Down
1 change: 1 addition & 0 deletions src/DocumentationBuilder.hack
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class DocumentationBuilder {
|> Str\join($$, "\n\n");

$parser_ctx = new Markdown\ParserContext();
$parser_ctx->setSourceType(Markdown\SourceType::TRUSTED);
$ast = Markdown\parse($parser_ctx, $md);

$render_ctx = (new MarkdownExt\RenderContext())
Expand Down
6 changes: 5 additions & 1 deletion src/IndexDocumentBuilder.hack
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class IndexDocumentBuilder {
string $markdown,
): string {
$body = $markdown
|> Markdown\parse(new Markdown\ParserContext(), $$)
|> Markdown\parse(
(new Markdown\ParserContext())
->setSourceType(Markdown\SourceType::TRUSTED),
$$,
)
|> (new Markdown\HTMLRenderer(new Markdown\RenderContext()))
->render($$);

Expand Down

0 comments on commit ff89604

Please sign in to comment.