Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
div_id = SecureRandom.hex(10)
[
"<div id=\"#{div_id}\"></div>",
"<script type=\"text/jsx\">",
" React.render(",
"<script type=\"text/babel\">",
" ReactDOM.render(",
" #{code.strip},",
" document.getElementById('#{div_id}')",
" );",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type='text/jsx'><%= rendered_example %></script>
<script type='text/babel'><%= rendered_example %></script>
<div class="codeBlock jsExample">
<div class="highlight">
<pre><%= code_example %></pre>
Expand Down
6 changes: 3 additions & 3 deletions spec/block_code_renderer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"<div class=\"codeExample\">",
" <div class=\"exampleOutput\">",
" <div id=\"#{div_id}\"></div>",
"<script type=\"text/jsx\">",
" React.render(",
"<script type=\"text/babel\">",
" ReactDOM.render(",
" <ReactExample property=\"value\">Example</ReactExample>,",
" document.getElementById('#{div_id}')",
" );",
Expand Down Expand Up @@ -237,7 +237,7 @@
let(:code) { '$(document).ready(function () { React.render(<div className="foo"></div>) });' }

it "inserts the code into the docs so that it will run and make the example work" do
expect(subject).to include "<script type='text/jsx'>$(document).ready(function () { React.render(<div className=\"foo\"></div>) });</script>"
expect(subject).to include "<script type='text/babel'>$(document).ready(function () { React.render(<div className=\"foo\"></div>) });</script>"
end

it { is_expected.to include [
Expand Down