Skip to content

Commit 7e2e19f

Browse files
committed
minor #110 Don't output errors (javiereguiluz)
This PR was merged into the main branch. Discussion ---------- Don't output errors This change is needed because otherwise, this happens: https://github.com/doctrine/rst-parser/blob/54024026d64fff84de645537015e30709a123ab1/lib/ErrorManager.php#L27-L29 This `echo` outputs the errors to the console, which is not that bad ... but also to the webpage contents (e.g. when using #109 to parse RST blog posts). We manage the build results and the errors explicitly, so we don't need this for Symfony docs. Thanks! Commits ------- e8e6ee2 Don't output errors
2 parents 5f750ad + e8e6ee2 commit 7e2e19f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/KernelFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class KernelFactory
2929
public static function createKernel(BuildConfig $buildConfig, ?UrlChecker $urlChecker = null): Kernel
3030
{
3131
$configuration = new RSTParserConfiguration();
32+
// needed to avoid outputting parser errors on the console output or the webpage contents
33+
$configuration->silentOnError(true);
3234
$configuration->setCustomTemplateDirs([__DIR__.'/Templates']);
3335
$configuration->setTheme($buildConfig->getTheme());
3436
$configuration->setCacheDir(sprintf('%s/var/cache', $buildConfig->getCacheDir()));

0 commit comments

Comments
 (0)