Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.26 KB

0.4-0.5.md

File metadata and controls

44 lines (30 loc) · 1.26 KB

From 0.4 to 0.5

Important changes

  • Sir Trevor textareas now output html rather than markdown
  • Scribe is now used for text formatting

Sir Trevor textareas now output html rather than markdown

When a block is saved SirTrevor will no longer save text as markdown, but will output valid html.

# Old

{
  "type": "text",
  "data": {
    "text": "One _two_ **three** [four](http://example.com)"
  }
}

# New

{
  "type": "text",
  "data": {
    "text": "One <i>two</i> <b>three</b> <a href='http://example.com'>four</a>",
    "format": "html"
  }
}

Sir Trevor will still load existing blocks formatted in Markdown, but will migrate the block data on save.

You'll need to make sure your markdown parser accepts html or provide an alternative filter when the html format property is present.

An example of how we deal with this in the sir-trevor-rails can be found here: https://github.com/madebymany/sir-trevor-rails/blob/master/lib/sir_trevor_rails/helpers/view_helper.rb#L9

Scribe is now used for text formatting

We now use Scribe to edit text rather than a mix of html/markdown. If you have built custom formatters for the existing codebase then these will need to be migrated accordingly.

For more info on scribe go here: https://github.com/guardian/scribe