Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issues with extraneous paragraphs in extracted strings.

  • Loading branch information...
commit af60424c5f5d94b09fb5bde67ed9e5708ed66ed0 1 parent 2f199d6
@jeresig jeresig authored
View
4 build/extract_strings_test.py
@@ -94,6 +94,10 @@ def test_json_output_from_all_files(self):
self.assertNotRegexpMatches(string, r'<div',
'DIV element found in %s' % list(output[string])[0][0])
+ # Make sure that no <p> are found in the extracted string
+ self.assertNotRegexpMatches(string, r'<p',
+ 'P element found in %s' % list(output[string])[0][0])
+
def _slurp_file(path, filename):
"""Read in the entire contents of a file, return as a string."""
View
7 exercises/angle_addition_postulate.html
@@ -59,13 +59,14 @@
</div>
<div class="problem">
- <div>Given<br />
+ <div><p>Given
<span data-if="PROBLEM===2"><span><code>\qquad \overrightarrow{<var>O</var><var>A</var>}\perp\overrightarrow{<var>O</var><var>C</var>}</code></span>,<br /> </span>
<span id="given0"><code>\qquad m <var>ANGLE_ONE</var> = <var>COEF_1</var>x + <var>CONST_1</var></code></span>, <span data-if="PROBLEM !== 0">and</span><br/>
<span id="given1"><code>\qquad m <var>ANGLE_TWO</var> = <var>COEF_2</var>x + <var>CONST_2</var></code></span><span data-if="PROBLEM !==0">,<br /></span>
<span data-if="PROBLEM === 0">, and<br />
- <span id="givenLarge"><code>\qquad m <var>LARGE_ANGLE</var> = <var>largeAngle</var></code></span>,</span>
- <p class="question">find <code>m<var>ANSWER[0]</var></code>.</p></div>
+ <span id="givenLarge"><code>\qquad m <var>LARGE_ANGLE</var> = <var>largeAngle</var></code></span>,</span></p>
+ <p class="question">find <code>m<var>ANSWER[0]</var></code>.</p>
+ </div>
<div id="angleGraph" class="graphie">
init({
View
2  exercises/fractions_cut_and_copy_2.html
@@ -122,7 +122,7 @@
<p data-if="CODE_OFFSPRING_2 !== fraction( N_OFFSPRING_2, D_OFFSPRING_2)">The goal block 1 of length <code><var>CODE_OFFSPRING_2</var></code> units
can be rewritten as <code><var>fraction(N_OFFSPRING_2, D_OFFSPRING_2)</var></code>.</p>
<p>Cutting the starting block into <code>x</code> pieces is the same as dividing it by <code>x</code>.</p>
- <p>We want to cut the starting block into a piece that can be copied into both goal block 1 and goal block 2.</p>A
+ <p>We want to cut the starting block into a piece that can be copied into both goal block 1 and goal block 2.</p>
<p>The least common denominator of <code><var>D_OFFSPRING_1</var></code> and <code><var>D_OFFSPRING_2</var></code> (the denominators of the goal blocks) is
<code><var>LCM</var></code>. Therefore you can copy a block <code>\dfrac{1}{<var>LCM</var>}</code> units long to make both goal blocks.</p>
<p>To find the number of slices to cut the starting block into we solve for <code>s</code> in the following equation:</p>
View
6 exercises/graphing_linear_equations.html
@@ -18,7 +18,7 @@
</div>
<div class="question">
- Graph the following equation:
+ <p>Graph the following equation:</p>
<p class="hint_blue">
<code><var>expr([ "*", B, "y" ])</var> = <var>C</var></code>
</p>
@@ -82,7 +82,7 @@
</div>
<div class="question">
- Graph the following equation:
+ <p>Graph the following equation:</p>
<p class="hint_blue">
<code><var>expr([ "*", B, "x" ])</var> = <var>C</var></code>
</p>
@@ -162,7 +162,7 @@
</div>
<div class="question">
- Graph the following equation:
+ <p>Graph the following equation:</p>
<p class="hint_blue" data-if="STD_FORM">
<code><var>expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ])</var> = <var>C</var></code>
</p>
View
5 exercises/graphs_of_inequalities.html
@@ -102,11 +102,10 @@
<var> LESS_THAN ? "less than" : "greater than" </var> <var> Y1 </var>. So we should use a <var>LESS_THAN ? "&lt; or &le;" : "&gt; or &ge;" </var> sign.
</p>
<div>
- Another way to see this is to try plugging in a point. The easiest point to plug in is <code>(0,0)</code>:
+ <p>Another way to see this is to try plugging in a point. The easiest point to plug in is <code>(0,0)</code>:</p>
<p><code>y \; ? \; <var>( SLOPE === -1 ? "-" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
<p><code>0 \; ? \; <var>( SLOPE === -1 ? "-1*" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ) + "*"))</var> 0 + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
- Since <code>(0,0)</code> is <var> ORI_IN ? "" : "not"</var> in the shaded area, this expression must be <var> ORI_IN ? "true" : "false"</var> So, the ? must be either <var>LESS_THAN ? "&lt; or &le;" : "&gt; or &ge;" </var>.
- </br>
+ <p>Since <code>(0,0)</code> is <var> ORI_IN ? "" : "not"</var> in the shaded area, this expression must be <var> ORI_IN ? "true" : "false"</var> So, the ? must be either <var>LESS_THAN ? "&lt; or &le;" : "&gt; or &ge;" </var>.</p>
</div>
<p>
The line of the graph is <var>INCLUSIVE ? "solid" : "dashed"</var>, so the points on the boundary are <var>INCLUSIVE ? "" : "not"</var>
View
4 exercises/midpoint_formula.html
@@ -90,7 +90,7 @@
<div class="solution" data-type="multiple">
- <code>\Large{(}</code><span class="sol"><var>XM</var></span>, <span class="sol"><var>YM</var></span><code>\Large{)}</code>
+ <p><code>\Large{(}</code><span class="sol"><var>XM</var></span>, <span class="sol"><var>YM</var></span><code>\Large{)}</code></p>
<p class="example"> integers, like <code>6</code></p>
<p class="example"> simplified proper fractions, like <code>3/5</code></p>
<p class="example"> simplified improper fractions, like <code>7/4</code></p>
@@ -160,7 +160,7 @@
</div>
<div class="solution" data-type="multiple">
- (<span class="sol"><var>X2</var></span>, <span class="sol"><var>Y2</var></span>)
+ <p>(<span class="sol"><var>X2</var></span>, <span class="sol"><var>Y2</var></span>)</p>
<p class="example"> integers, like <code>6</code></p>
<p class="example"> simplified proper fractions, like <code>3/5</code></p>
<p class="example"> simplified improper fractions, like <code>7/4</code></p>
View
4 exercises/one_step_equation_intuition.html
@@ -201,8 +201,8 @@
<div class="solution" data-type="custom">
<div class="instruction">
- Balance the scale with <var>UNKNOWN</var> <b>alone on
- one side</b> and enter the weight:
+ <p>Balance the scale with <var>UNKNOWN</var> <b>alone on
+ one side</b> and enter the weight:</p>
<p><input id="answer" type="text" /></p>
</div>
<div class="guess">[
View
6 exercises/permutations_1.html
@@ -19,13 +19,13 @@
<p class="solution" data-forms="integer"><var>ANSWER</var></p>
<div class="hints">
<div>
- Let's try building the re-arrangements (or permutations) letter by letter. The word is <var>WORD.length</var>
- letters long:
+ <p>Let's try building the re-arrangements (or permutations) letter by letter. The word is <var>WORD.length</var>
+ letters long:</p>
<p><var>_.map(_.range(WORD.length), function(l){ return "_ "; }).join("")</var></p>
<p>Now, for the first blank, we have <var>WORD.length</var> choices of letters to put in.
</div>
<div>
- After we put in the first letter, let's say it's <var>PERM[0]</var>, we have <var>WORD.length-1</var> blanks left.
+ <p>After we put in the first letter, let's say it's <var>PERM[0]</var>, we have <var>WORD.length-1</var> blanks left.</p>
<p><var>PERM[0]+" "+_.map(_.range(WORD.length-1), function(l){ return "_ "; }).join("")</var></p>
<p>For the second blank, we only have <var>WORD.length-1</var> choices of letters left to put in. So far, there were
<code><var>WORD.length</var> \cdot <var>WORD.length-1</var></code> unique choices we could have made.</p>
View
22 exercises/permutations_and_combinations_2.html
@@ -48,35 +48,33 @@
<p class="solution" data-forms="integer"><var>ANSWER</var></p>
<div class="hints">
<div>
- Let's try building the arrangements (or permutations) letter by letter. The word is <code><var>WORD.length</var></code>
- letters long:
+ <p>Let's try building the arrangements (or permutations) letter by letter. The word is <code><var>WORD.length</var></code>
+ letters long:</p>
<p><var>_.map(_.range(WORD.length), function(l){ return "_ "; }).join("")</var></p>
<p>Now, for the first blank, we have <code><var>WORD.length</var></code> choices of letters to put in.
</div>
<div>
- After we put in the first letter, let's say it's <var>PERM[0]</var>, we have <code><var>WORD.length-1</var></code> blanks left.
+ <p>After we put in the first letter, let's say it's <var>PERM[0]</var>, we have <code><var>WORD.length-1</var></code> blanks left.</p>
<p><var>PERM[0]+" "+_.map(_.range(WORD.length-1), function(l){ return "_ "; }).join("")</var></p>
<p>For the second blank, we only have <code><var>WORD.length-1</var></code> choices of letters left to put in. So far, there were
<code><var>WORD.length</var> \cdot <var>WORD.length-1</var></code> unique choices we could have made.</p>
</div>
<div>
- We can continue in this fashion to put in a third letter, then a fourth, and so on. At each step, we have one fewer choice to
- make, until we get to the last letter, and there's only one we can put in.
- </br></br>
+ <p>We can continue in this fashion to put in a third letter, then a fourth, and so on. At each step, we have one fewer choice to
+ make, until we get to the last letter, and there's only one we can put in.</p>
</div>
<div>
- Using this method, the total number of arrangements is <code><var>_.map(_.range(WORD.length).reverse(), function(l){ return (++l);}).join("\\cdot")</var> = <var>factorial(WORD.length)</var>.</code> Another way of writing this is <code><var>WORD.length</var>!</code>,
- or <code><var>WORD.length</var></code> factorial, but this isn't quite the right answer.
- </br></br>
+ <p>Using this method, the total number of arrangements is <code><var>_.map(_.range(WORD.length).reverse(), function(l){ return (++l);}).join("\\cdot")</var> = <var>factorial(WORD.length)</var>.</code> Another way of writing this is <code><var>WORD.length</var>!</code>,
+ or <code><var>WORD.length</var></code> factorial, but this isn't quite the right answer.</p>
</div>
<div>
- Using the above method, we assumed that all the letters were unique. But they're not! There are <code><var>REPTIMES</var></code>
+ <p>Using the above method, we assumed that all the letters were unique. But they're not! There are <code><var>REPTIMES</var></code>
<var>REPLETTER</var>s, so we're counting every permutation multiple times. So every time we have these
- <code><var>factorial(REPTIMES)</var></code> permutations:
+ <code><var>factorial(REPTIMES)</var></code> permutations:</p>
<p>
<var>PERM_UNIQUE.join("&lt;/br&gt;")</var>
</p>
- We actually should have only one permutation:
+ <p>We actually should have only one permutation:</p>
<p>
<var>PERM</var>
</p>
View
12 exercises/pythagorean_theorem_2.html
@@ -76,7 +76,7 @@
<code>\sin{45}^{\circ} = \dfrac{\sqrt{2}}{2}</code>.</p>
</div>
<div>
- Solving for <code>x</code>, we get
+ <p>Solving for <code>x</code>, we get</p>
<p><code>\qquad x \cdot \sin {45}^{\circ} =
<var>AC</var></code></p>
<p><code>\qquad x \cdot \dfrac{\sqrt{2}}{2} =
@@ -138,7 +138,6 @@
Solving for <code>x</code>, we get
<code>x = <var>AB</var> \cdot \cos {45}^{\circ}
= <var>AB</var> \cdot \dfrac{\sqrt{2}}{2}</code>
- </br>
</p>
<p>
So, <code>x = <var>AB/2</var> \sqrt{2}</code>.
@@ -194,7 +193,6 @@
Solving for <code>x</code>, we get
<code>x = <var>AB</var>\sqrt{2} \cdot \cos {45}^{\circ}
= <var>AB</var>\sqrt{2} \cdot \dfrac{\sqrt{2}}{2}</code>
- </br>
</p>
<p>
So, <code>x = <var>AB</var>
@@ -251,7 +249,7 @@
that <code>\sin{30}^{\circ} = \dfrac{1}{2}</code>.</p>
</div>
<div>
- Solving for <code>x</code>, we get
+ <p>Solving for <code>x</code>, we get</p>
<p><code>\qquad x \cdot \sin{30}^{\circ} =
<var>BCdisp</var></code></p>
<p><code>\qquad x \cdot \dfrac{1}{2} =
@@ -314,7 +312,7 @@
that <code>\cos{30}^{\circ} = \dfrac{\sqrt{3}}{2}</code>.</p>
</div>
<div>
- Solving for <code>x</code>, we get
+ <p>Solving for <code>x</code>, we get</p>
<p><code>\qquad x \cdot \cos{30}^{\circ} =
<var>ACdisp</var></code></p>
<p><code>\qquad x \cdot \dfrac{\sqrt{3}}{2} =
@@ -376,7 +374,7 @@
that <code>\cos{60}^{\circ} = \dfrac{1}{2}</code>.</p>
</div>
<div>
- Solving for <code>x</code>, we get
+ <p>Solving for <code>x</code>, we get</p>
<p><code>\qquad x = <var>ABdisp</var>
\cdot \cos{60}^{\circ}</code></p>
<p><code>\qquad x = <var>ABdisp</var> \cdot
@@ -437,7 +435,7 @@
that <code>\sin{60}^{\circ} = \dfrac{\sqrt{3}}{2}</code>.</p>
</div>
<div>
- Solving for <code>x</code>, we get
+ <p>Solving for <code>x</code>, we get</p>
<p><code>\qquad x = <var>ABs</var>
\cdot \sin{60}^{\circ}</code></p>
<p><code>\qquad x = <var>ABs</var> \cdot
View
6 exercises/rate_problems_2.html
@@ -41,7 +41,7 @@
<p class="question">What is <var>his( 1 )</var> average speed for the entire trip from home to the <var>store( 1 )</var> store and back?</p>
<div class="solution" data-type="multiple">
- <span class="sol" style="padding-right: 5px"><var>RATE_AVG</var></span> mph
+ <p><span class="sol" style="padding-right: 5px"><var>RATE_AVG</var></span> mph</p>
</div>
<div class="hints">
@@ -93,7 +93,7 @@
<p class="question">How many minutes does it take <var>PEOPLE_FINAL</var> people to paint <var>WALL_FINAL</var> walls?</p>
<div class="solution" data-type="multiple">
- <span class="sol" style="padding-right: 5px"><var>TIME_FINAL</var></span> minutes
+ <p><span class="sol" style="padding-right: 5px"><var>TIME_FINAL</var></span> minutes</p>
</div>
<div class="hints">
<p>Imagine that each person is assigned one wall, and all <var>PEOPLE_INIT</var> people begin painting at the same time.</p>
@@ -115,7 +115,7 @@
<p class="problem"><var>PEOPLE_INIT</var> people can paint <var>WALL_INIT</var> walls in <var>TIME_INIT</var> minutes.</p>
<p class="question">How many minutes will it take for <var>PEOPLE_FINAL</var> people to paint <var>WALL_FINAL</var> walls? Round to the nearest minute.</p>
<div class="solution" data-type="multiple">
- <span class="sol" style="padding-right: 5px" data-forms="integer"><var>TIME_FINAL</var></span> minutes
+ <p><span class="sol" style="padding-right: 5px" data-forms="integer"><var>TIME_FINAL</var></span> minutes</p>
<p class="example">the number of minutes, rounded to the nearest minute</p>
</div>
<div class="hints">
View
2  exercises/the_fundamental_theorem_of_arithmetic.html
@@ -169,7 +169,7 @@
<div class="solution" data-type="custom">
<div class="instruction">
- Click the orange arrows to change your answer.
+ <p>Click the orange arrows to change your answer.</p>
<p id="answer-preview"><code>=1</code></p>
</div>
<div class="guess">GRAPHIE.computeTotal()</div>
View
24 exercises/trig_addition_identities.html
@@ -206,7 +206,7 @@
\sin(<var>S_ANG</var>)</code></p>
</div>
<div>
- Now we just need to evaluate each term.
+ <p>Now we just need to evaluate each term.</p>
<p><code>\qquad \sin(<var>T_ANG</var>) =
\dfrac{Opposite}{Hypotenuse} =
\dfrac{<var>OPPOSITE_NAME</var>}
@@ -223,7 +223,7 @@
<var>TERM4</var></code></p>
</div>
<div>
- Putting it together, we get
+ <p>Putting it together, we get</p>
<p><code>\qquad <var>TERM1</var> \cdot <var>TERM2</var>
<var>OP</var> <var>TERM3</var> \cdot <var>TERM4</var>
= <var>ANS_DISPLAY</var>
@@ -333,7 +333,7 @@
\sin(<var>S_ANG</var>)</code></p>
</div>
<div>
- Now we just need to evaluate each term.
+ <p>Now we just need to evaluate each term.</p>
<p><code>\qquad \cos(<var>T_ANG</var>) =
\dfrac{Adjacent}{Hypotenuse} =
\dfrac{<var>ADJACENT_NAME</var>}
@@ -350,7 +350,7 @@
<var>TERM4</var></code></p>
</div>
<div>
- Putting it together, we get
+ <p>Putting it together, we get</p>
<p><code>\qquad <var>TERM1</var> \cdot <var>TERM2</var>
<var>OP2</var> <var>TERM3</var> \cdot <var>TERM4</var>
= <var>ANS_DISPLAY</var>
@@ -424,10 +424,10 @@
[<a href="#" class="show-subhint" data-subhint="sinDeriv">
Show how</a>]</p>
<div class="subhint" id="sinDeriv">
- Start with the sine angle addition identity:
+ <p>Start with the sine angle addition identity:</p>
<p><code>\qquad \sin(x + y) = \sin(x) \cdot \cos(y)
+ \cos(x) \cdot \sin(y)</code></p>
- Now take the case where <code>x = y</code>:
+ <p>Now take the case where <code>x = y</code>:</p>
<p><code>\qquad \sin(x + y) = \sin(x + x)
= \sin(x) \cdot \cos(x) + \cos(x) \cdot \sin(x)
</code></p>
@@ -435,7 +435,7 @@
</div>
</div>
<div>
- Now we just need to evaluate each term.
+ <p>Now we just need to evaluate each term.</p>
<p><code>\qquad \sin(<var>T_ANG</var>) =
\dfrac{Opposite}{Hypotenuse} =
\dfrac{<var>OPPOSITE_NAME</var>}
@@ -448,7 +448,7 @@
<var>TERM2</var></code></p>
</div>
<div>
- Putting it together, we get
+ <p>Putting it together, we get</p>
<p><code>\qquad 2 \cdot <var>TERM1</var>
\cdot <var>TERM2</var>
= <var>ANS_DISPLAY</var>
@@ -525,10 +525,10 @@
[<a href="#" class="show-subhint" data-subhint="cosDeriv">
Show how</a>]</p>
<div class="subhint" id="cosDeriv">
- Start with the cosine angle addition identity:
+ <p>Start with the cosine angle addition identity:</p>
<p><code>\qquad \cos(x + y) = \cos(x) \cdot \cos(y)
- \sin(x) \cdot \sin(y)</code></p>
- Now take the case where <code>x = y</code>:
+ <p>Now take the case where <code>x = y</code>:</p>
<p><code>\qquad \cos(x + y) = \cos(x + x)
= \cos(x) \cdot \cos(x) - \sin(x) \cdot \sin(x)
</code></p>
@@ -537,7 +537,7 @@
</div>
</div>
<div>
- Now we just need to evaluate each term.
+ <p>Now we just need to evaluate each term.</p>
<p><code>\qquad \cos^2(<var>T_ANG</var>) =
\left(\dfrac{Adj}{Hyp}\right)^2 =
\left(\dfrac{<var>ADJACENT_NAME</var>}
@@ -554,7 +554,7 @@
<var>TERM2</var></code></p>
</div>
<div>
- Putting it together, we get
+ <p>Putting it together, we get</p>
<p><code>\qquad <var>TERM1</var>
- <var>TERM2</var>
= <var>ANS_DISPLAY</var>
Please sign in to comment.
Something went wrong with that request. Please try again.