Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering content as HTML #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/raddocs/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/views/example.haml
Original file line number Diff line number Diff line change
@@ -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 "&laquo; Back to Index", "/"
= (link_to "&laquo; Back to Index", "/").html_safe

%h1== #{example.resource} API
- if example.resource_explanation?
Expand Down
6 changes: 3 additions & 3 deletions lib/views/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions lib/views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
}

%body
.container
= yield
.container
= yield.html_safe
2 changes: 1 addition & 1 deletion lib/views/nav.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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