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

Use xhp for html rendering #27

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9415eeb
Remove HH_FIXME for ENT_HTML5
lexidor May 27, 2023
572bf9d
Require xhp-lib
lexidor May 27, 2023
e625dd9
Format the affect files
lexidor May 27, 2023
94aac71
Shift hhast into top gear
lexidor May 27, 2023
8d8282b
Lint PreferSingleQuotedStringLiteral
lexidor May 27, 2023
8134e9d
Lint NoFinalMethodInFinalClass
lexidor May 27, 2023
dccc276
Lint DontHaveTwoEmptyLinesInARow
lexidor May 27, 2023
799edc0
Disable FinalOrAbstractClassLinter
lexidor May 27, 2023
32a5de5
Disable UseStatementWithAsLinter
lexidor May 27, 2023
228532a
Lint NoEmptyStatementsLinter
lexidor May 27, 2023
9ff4e8c
Lint clean with "all"
lexidor May 27, 2023
0bf465f
Remove needless null check with help from HHClientLinter
lexidor May 27, 2023
cbc51f9
Introduce a couple hacks to aid in the migration
lexidor May 27, 2023
b02c8d9
Prepare for boolean attributes in tests
lexidor May 27, 2023
c8fdbdd
Introduce an escape hatch for XHP rendering
lexidor May 27, 2023
b5e961a
Create covariant interface IRenderer<T>
lexidor May 27, 2023
82ba6dd
Prepare the tests for a new renderer
lexidor May 27, 2023
728a277
Fix doubly normalized html in tests
lexidor May 27, 2023
c5f3fd4
FAILING_TEST_ON_PURPOSE_TO_ENSURE_THIS_IS_COVERED
lexidor May 27, 2023
30979eb
Change the type of HTMLXhpRenderer to Render<node>
lexidor May 27, 2023
19916da
Move simple cases to native XHP
lexidor May 27, 2023
1e5646d
Emit images with xhp
lexidor May 27, 2023
8a5c5b4
Move more simple cases to native XHP
lexidor May 27, 2023
666c388
Render lists with XHP
lexidor May 27, 2023
b60ab93
Remove the last FORCE_RENDER() call in HTMLXHPRenderer
lexidor May 27, 2023
c6a0f40
Make DO_NOT_ESCAPE_ATTRIBUTE slightly less dangerous
lexidor May 27, 2023
63148c2
Remove FORCE_RENDER
lexidor May 27, 2023
9482d13
Increase the scare factor of DO_NOT_ESCAPE()
lexidor May 27, 2023
6b25e2c
Factor out escape_uri_attribute
lexidor May 27, 2023
fb18394
Wrap the HTMLXHPRenderer in a Renderer<string>
lexidor May 27, 2023
69b6b88
Put HTMLRenderer::URI_SAFE back for BC
lexidor May 27, 2023
86ec5dc
Lint almost clean (including HHClientLinter)
lexidor May 27, 2023
999f859
Optimization found by HHClientLinter
lexidor May 27, 2023
c096490
Remove needless xhp_join() calls
lexidor May 27, 2023
c53319a
Update README to mention RenderableAsXHP
lexidor May 27, 2023
4a55838
Remove hhvm(-autoload) requirement
lexidor May 27, 2023
08e5859
Fix CI
lexidor May 27, 2023
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
Prev Previous commit
Next Next commit
Remove FORCE_RENDER
lexidor committed May 27, 2023
commit 63148c2aab9e8fa5e80dc6d41fe437a42366cdca
38 changes: 0 additions & 38 deletions src/_Private/FORCE_RENDER.php

This file was deleted.

7 changes: 5 additions & 2 deletions src/render/HTMLRenderer.php
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
namespace Facebook\Markdown;

use namespace HH\Lib\{C, Str, Vec};
use namespace HH\Asio;

class HTMLRenderer extends Renderer<string> {
const keyset<classname<RenderFilter>> EXTENSIONS = keyset[
@@ -68,8 +69,10 @@ protected function renderNodes(vec<ASTNode> $nodes): string {
protected function renderResolvedNode(ASTNode $node): string {
if ($node is RenderableAsXHP) {
$xhp_renderer = new HTMLXHPRenderer($this->getContext());
return $node->renderAsXHP($this->getContext(), $xhp_renderer)
|> _Private\FORCE_RENDER($$);
// HHAST_IGNORE_ERROR[DontUseAsioJoin]
return Asio\join(
$node->renderAsXHP($this->getContext(), $xhp_renderer)->toStringAsync(),
);
}

// This interface is implemented by users of this library.