Bug #1090

All code listings in every article are broken because of Haml templates

Added by hipertracker - 544 days ago. Updated 543 days ago.

Status :Closed Start :
Priority :High Due date :
Assigned to :scott - % Done :

0%

Category :frontend
Target version :-
Resolution :

invalid


Description

Changing from ERb to Haml in latest SVN version of Typo destroys all code listings in every article because Haml templates add indentation to every HTML tag, and <typo:code> macro use

 HTML tag. So only first line is displayed OK, but all other lines in <typo:code>...</typo:code> are broken. :(

History

03/04/2007 05:20 AM - hipertracker -

The following hack can fix code listings:

In file app/views/articles/_article.haml instead of

= html article, :body

use this:

- captured = capture do
  = html article, :body
= captured.gsub(/[\n\r]{2,}/,"\n").gsub(/[\n]/, '<br style="margin-bottom:-20px" />')

And in file read.haml this line

  = html(@article)

use this:
  - captured = capture do
    = html(@article)
  = captured.gsub(/[\n\r]{2,}/,"\n").gsub(/[\n]/, '<br style="margin-bottom:-20px" />')

03/04/2007 09:41 AM - neuro -

  • Status changed from New to Closed
  • Resolution set to invalid

HAML templates has been removed from the trunk at changset 1374.

Also available in: Atom PDF