From c44571303c567dd2ffb6d54b2fe9df5ba3e1a12f Mon Sep 17 00:00:00 2001 From: Adam Migodzinski Date: Thu, 23 Mar 2023 07:30:53 +0100 Subject: [PATCH] Fix rendering content as HTML --- lib/raddocs/app.rb | 2 +- lib/views/example.haml | 4 ++-- lib/views/index.haml | 6 +++--- lib/views/layout.haml | 4 ++-- lib/views/nav.haml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/raddocs/app.rb b/lib/raddocs/app.rb index 5608737..395f1b6 100644 --- a/lib/raddocs/app.rb +++ b/lib/raddocs/app.rb @@ -61,7 +61,7 @@ class App < Sinatra::Base index = Index.new(File.join(docs_dir, "index.json")) example = Example.new(file) - haml :example, :locals => { index: index, example: example } + (haml :example, :locals => { index: index, example: example }).html_safe end # Page not found diff --git a/lib/views/example.haml b/lib/views/example.haml index 84d7066..b0b400a 100644 --- a/lib/views/example.haml +++ b/lib/views/example.haml @@ -1,12 +1,12 @@ .row-fluid .span4.sidebar - = haml :nav, locals: { index: index, api_name: api_name } + = (haml :nav, locals: { index: index, api_name: api_name }).html_safe .span10.main %script(src="#{url_location}/js/example.js") .nav-bar - = link_to "« Back to Index", "/" + = (link_to "« Back to Index", "/").html_safe %h1== #{example.resource} API - if example.resource_explanation? diff --git a/lib/views/index.haml b/lib/views/index.haml index 80da1d6..41fdb73 100644 --- a/lib/views/index.haml +++ b/lib/views/index.haml @@ -5,7 +5,7 @@ %ul.guides - guides.each do |guide| %li.guide - = link_to guide.title, "/#{guide.href}" + = (link_to guide.title, "/#{guide.href}").html_safe - index.resources.each do |resource| .resource @@ -15,5 +15,5 @@ = resource.explanation %ul.examples - resource.examples.each do |example| - %li.example - = link_to example.description, "/#{example.href}" + %li.example + = (link_to example.description, "/#{example.href}").html_safe diff --git a/lib/views/layout.haml b/lib/views/layout.haml index ec4067e..da5b07f 100644 --- a/lib/views/layout.haml +++ b/lib/views/layout.haml @@ -27,5 +27,5 @@ } %body - .container - = yield + .container + = yield.html_safe diff --git a/lib/views/nav.haml b/lib/views/nav.haml index c1611b9..73ca4b9 100644 --- a/lib/views/nav.haml +++ b/lib/views/nav.haml @@ -5,4 +5,4 @@ %ul.examples - resource.examples.each do |example| %li.example - = link_to example.description, "/#{example.href}" + = (link_to example.description, "/#{example.href}").html_safe