Skip to content

0.1.2

Choose a tag to compare

@dereuromark dereuromark released this 23 Oct 16:48

Fixes

  • rawHtml now applies only under safeMode: true. With safeMode: 'strict' or an explicit SafeMode instance it is ignored, so an app-wide rawHtml: 'allow' can no longer let raw HTML through the comment preset or strict mode.
  • carve render, carve convert --output and carve format --write write through a temp file and rename it over the target, so a failed write leaves the original intact. The command needs write access to the target's directory, and refuses a file owned by another user rather than taking it over.
  • Configured extensions now run for text, Markdown and ANSI output, not only HTML.
  • CarveBehavior regenerates its text and TOC fields when one of them was set directly, as it already did for the HTML field.
  • A layout placeholder value containing {{content}} no longer creates a second body slot in CarveView.
  • Validation option strict used to be passed to the engine as strict parsing, undocumented. It now fails validation on any parse warning and names up to three of them.

Improvements

  • rawHtml (strip, escape, allow) sets raw HTML handling under safeMode: true. allow passes raw HTML verbatim and is for trusted authors only; the default stays the engine's.
  • cache.version enters the cache key and allows caching with extension instances, closures and renderers. A closure is keyed by where it is defined and the values it captures; one whose captures cannot be serialized is not cached.
  • includeResolver takes a custom include resolver for renderFile(); implementing IncludeCacheKeyProvider lets it take part in the file cache.
  • CarveRenderer::lintFile() lints a file with its includes through the configured resolver; carve lint uses it.
  • carve render --format html|text|markdown|ansi, backed by the new CarveRenderer::toAnsi() and renderFileAs().
  • carve format --align-tables, and format() takes $alignTables.
  • CarveHelper::file(), lint() and format().
  • Diagram presets d2, graphviz, wavedrom, abc, vega_lite and chart are available by name.
  • File render reports expose dependencies() and suppressedWarnings().

CarveRendererInterface gains toAnsi(), renderFileAs() and lintFile(), and format() gains an optional $alignTables. Custom renderers implementing the interface need these additions.

Full Changelog: 0.1.1...0.1.2