ng-doc / ng-doc

📃 The documentation engine for Angular projects
https://ng-doc.com
MIT License
220 stars 23 forks source link

[Bug] render error: expression is evaluated in code block #227

Open beig opened 2 hours ago

beig commented 2 hours ago

Is this a regression?

No

Description

I am trying to create a code-block which contains angular html template syntax

e.g. describing the use of transloco's directive

<p>{{ t('title') }}</p>

An unhandled exception occurred: (src/app/docs/button/index.md) [Line 36, Column 9]
  Template render error: (src/app/docs/button/index.md)
  Template render error: (src/app/docs/shared/import-alert.md)
  Error: Unable to call `t`, which is undefined or falsey
See "/tmp/ng-NelTFi/angular-errors.log" for further details.

Please provide the exception or error you saw

No response

OS

Windows

Browser

Chrome

Node version

v22.3.0

Anything else?

No response

beig commented 2 hours ago

setting the code block to shelland escaping the first 2 { does provide a workaround

<p>\{\{ t('title') }}</p>