Yes:
  - if @decision.html.blank?
    %h2 An HTML version of this decision is not currently available.
  - else
    .decision
      %h2 The decision
      .decision-inner
        = @decision.html.html_safe


Max.


On 29 July 2013 14:16, Jan Szumiec <notifications@github.com> wrote:

> In app/models/decision.rb:
>
> > @@ -109,7 +109,20 @@ def process_doc
> >    end
> >
> >    def set_html_from_text
> > -    self.html = self.text.gsub(/\n/, '<br/>')
> > +    if self.text
> > +      # line breaks
> > +      self.html = self.text.gsub(/\n/, '<br/>')
> > +
> > +      # references to other decisions
> > +      citation_pattern = /\[[0-9]{4}\]\s*[0-9]*\s+[A-Z]+\s*[A-Za-z\.]*\s*[0-9]*/ # (see http://ox.libguides.com/content.php?pid=141334&sid=1205598)
> > +
> > +      self.html = self.html.gsub(citation_pattern) do |citation|
> > +        normalised_citation = citation.gsub(/\s+0+([1-9])/, ' \1')
> > +        decision = Decision.find_by(appeal_number: normalised_citation) || (next citation)
> > +        decision_url = Tribunals::Application.routes.url_helpers.decision_path(decision)
> > +        "<a href='"+decision_url+"'>"+citation+"</a>"
>
> Is this field self.html displayed using .html_safe in the view?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ministryofjustice/tribunals/pull/13/files#r5449011>
> .
>