laminas / documentation-theme

Documentation theme for Laminas and Mezzio
2 stars 10 forks source link

Problems with rendering in templates with PHP and HTML #29

Closed froschdesign closed 4 years ago

froschdesign commented 4 years ago

Bug Report

Q A
Version(s) master

Summary

The rendering of some code examples with PHP and HTML are wrong.

Example: https://docs.mezzio.dev/mezzio/v3/features/template/plates/#escaperextension

Current behavior

<html>
  <head>
    <meta name="author" content="<?= $this->escapeHtmlAttr($this->author) ?>">
    <link rel="alternative" href="<?= $this->escapeUrl($this->alternative) ?>">
    <style>___PHP2___</style>
    <script>___PHP3___</script>
  </head>

  <body>
    ___PHP4___
  </body>
</html>

Expected behavior

<html>
  <head>
    <meta name="author" content="<?= $this->escapeHtmlAttr($this->author) ?>">
    <link rel="alternative" href="<?= $this->escapeUrl($this->alternative) ?>">
    <style><?= $this->escapeCss($this->styles) ?></style>
    <script><?= $this->escapeJs($this->script) ?></script>
  </head>

  <body>
    <?= $this->escapeHtml($this->content) ?>
  </body>
</html>

More examples

froschdesign commented 4 years ago

Fixed with the usage of Superfences from PyMdown Extensions.

Related to #14 and #35.