Skip to content

Configuration ​

yaml
# config/packages/carve.yaml
carve:
    safe_mode: true          # true | false | strict
    raw_html: strip          # strip | escape | allow
    profile: null            # null | full | article | comment | minimal
    on_disallowed: null      # null | strip | to_text | error
    mode: interactive        # interactive | static
    soft_break_mode: null    # null | newline | space | br
    xhtml: false
    source_lines: false
    smart_typography: null   # null | true | false
    symbols: {}              # trusted HTML for :name: symbols
    labels: {}
    extensions: []
    diagrams: []
    include_root: null       # absolute trusted filesystem root
    cache:
        enabled: false
        pool: cache.app
        ttl: null
        prefix: carve
        version: null
KeyTypeDefaultDescription
safe_modebool|stricttrueHTML sanitization. strict always strips raw HTML and also blocks style, srcdoc and formaction attributes. Keep it on for untrusted input.
raw_htmlenumstripHow raw HTML is handled when safe_mode is true: strip, escape, allow.
profileenum|nullnullRestrict markup features using full, article, comment, or minimal.
on_disallowedenum|nullnullWhat a profile does with disallowed markup: strip, to_text or error.
modeenuminteractivestatic applies graceful degradation for print, PDF, email and other script-free targets.
soft_break_modeenum|nullnullRender soft breaks as newline, space or br.
xhtmlboolfalseEmit XHTML-compatible self-closing tags.
source_linesboolfalseAdd 1-based data-source-line attributes for editor scroll-sync.
smart_typographybool|nullnullForce smart typography on or off.
symbolsmap{}HTML replacements for :name: symbols. Inserted unescaped, so never fill it from user input.
labelsmap{}Overrides for generated UI labels.
extensionslist[]carve-php extensions, see Extensions.
diagramsstring[][]Diagram fenced-block presets to enable, see Diagrams.
include_rootstring|nullnullAbsolute containment root for file-backed rendering.
cache.*mapoffRender caching, see Caching.

Setting safe_mode: false disables sanitization entirely. Only do this for fully trusted input. Unknown values are rejected when the container compiles.

Released under the MIT License.