maruku 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/docs/markdown_syntax.md +9 -21
- data/lib/maruku/defaults.rb +1 -1
- data/lib/maruku/element.rb +18 -3
- data/lib/maruku/ext/fenced_code.rb +1 -1
- data/lib/maruku/ext/math/mathml_engines/blahtex.rb +1 -1
- data/lib/maruku/ext/math/to_html.rb +2 -9
- data/lib/maruku/html.rb +5 -8
- data/lib/maruku/input/html_helper.rb +94 -81
- data/lib/maruku/input/mdline.rb +6 -4
- data/lib/maruku/input/parse_block.rb +145 -37
- data/lib/maruku/input/parse_span.rb +7 -8
- data/lib/maruku/input/rubypants.rb +22 -9
- data/lib/maruku/maruku.rb +5 -0
- data/lib/maruku/output/to_html.rb +15 -6
- data/lib/maruku/output/to_latex.rb +9 -3
- data/lib/maruku/output/to_s.rb +0 -1
- data/lib/maruku/string_utils.rb +2 -2
- data/lib/maruku/version.rb +1 -1
- data/spec/block_docs/abbrev.md +18 -18
- data/spec/block_docs/attribute_sanitize.md +22 -0
- data/spec/block_docs/auto_cdata.md +48 -0
- data/spec/block_docs/bug_table.md +4 -4
- data/spec/block_docs/code4.md +79 -0
- data/spec/block_docs/div_without_newline.md +16 -0
- data/spec/block_docs/empty_cells.md +3 -9
- data/spec/block_docs/entities.md +6 -12
- data/spec/block_docs/extra_table1.md +6 -6
- data/spec/block_docs/fenced_code_blocks.md +12 -20
- data/spec/block_docs/fenced_code_blocks_highlighted.md +1 -2
- data/spec/block_docs/footnotes2.md +4 -1
- data/spec/block_docs/ignore_bad_header.md +9 -0
- data/spec/block_docs/issue106.md +78 -0
- data/spec/block_docs/issue115.md +20 -0
- data/spec/block_docs/issue117.md +13 -0
- data/spec/block_docs/issue120.md +48 -0
- data/spec/block_docs/issue123.md +11 -0
- data/spec/block_docs/issue124.md +16 -0
- data/spec/block_docs/issue40.md +24 -12
- data/spec/block_docs/issue89.md +1 -1
- data/spec/block_docs/lists_nested_blankline.md +14 -8
- data/spec/block_docs/lists_ol.md +5 -5
- data/spec/block_docs/lists_paraindent.md +6 -11
- data/spec/block_docs/math-blahtex/equations.md +12 -13
- data/spec/block_docs/math-blahtex/math2.md +9 -2
- data/spec/block_docs/math/embedded_invalid_svg.md +31 -2
- data/spec/block_docs/math/embedded_svg.md +41 -2
- data/spec/block_docs/math/equations.md +7 -2
- data/spec/block_docs/math/inline.md +2 -2
- data/spec/block_docs/math/math2.md +9 -1
- data/spec/block_docs/math/spaces_after_inline_math.md +17 -0
- data/spec/block_docs/math/table.md +2 -2
- data/spec/block_docs/math/table2.md +6 -6
- data/spec/block_docs/table_attributes.md +4 -6
- data/spec/block_docs/table_colspan.md +41 -0
- data/spec/block_docs/tables.md +10 -21
- data/spec/block_docs/tables2.md +74 -0
- data/spec/block_docs/xml_comments.md +32 -0
- data/spec/span_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +42 -28
- metadata.gz.sig +3 -3
- data/spec/block_docs/xml2.md +0 -19
@@ -409,7 +409,7 @@ Created by \\href{#{MaRuKu::MARUKU_URL}}{Maruku} #{self.nice_date}.
|
|
409
409
|
def to_latex_table
|
410
410
|
num_columns = self.align.size
|
411
411
|
|
412
|
-
head, *rows = @children
|
412
|
+
head, *rows = @children
|
413
413
|
|
414
414
|
h = { :center => 'c' , :left => 'l' , :right => 'r'}
|
415
415
|
align_string = self.align.map {|a| h[a] }.join('|')
|
@@ -432,11 +432,17 @@ Created by \\href{#{MaRuKu::MARUKU_URL}}{Maruku} #{self.nice_date}.
|
|
432
432
|
|
433
433
|
|
434
434
|
def to_latex_head_cell
|
435
|
-
|
435
|
+
to_latex_cell
|
436
436
|
end
|
437
437
|
|
438
438
|
def to_latex_cell
|
439
|
-
|
439
|
+
s=""
|
440
|
+
if @attributes.has_key?(:colspan)
|
441
|
+
# TODO figure out how to set the alignment (defaulting to left for now)
|
442
|
+
s="\\multicolumn {"<< @attributes[:colspan]<<"}{|l|}{"<<children_to_latex<<"}"
|
443
|
+
else
|
444
|
+
children_to_latex
|
445
|
+
end
|
440
446
|
end
|
441
447
|
|
442
448
|
def to_latex_footnote_reference
|
data/lib/maruku/output/to_s.rb
CHANGED
data/lib/maruku/string_utils.rb
CHANGED
@@ -57,8 +57,8 @@ module MaRuKu
|
|
57
57
|
# @param s [String]
|
58
58
|
# @return [Fixnum]
|
59
59
|
def spaces_before_first_char(s)
|
60
|
-
|
61
|
-
|
60
|
+
s = MaRuKu::MDLine.new(s.gsub(/([^\t]*)(\t)/) { $1 + " " * (TAB_SIZE - $1.length % TAB_SIZE) })
|
61
|
+
match = case s.md_type
|
62
62
|
when :ulist
|
63
63
|
# whitespace, followed by ('*'|'+'|'-') followed by
|
64
64
|
# more whitespace, followed by an optional IAL, followed
|
data/lib/maruku/version.rb
CHANGED
data/spec/block_docs/abbrev.md
CHANGED
@@ -415,17 +415,17 @@ md_el(:document,[
|
|
415
415
|
*** Output of to_html ***
|
416
416
|
<h1 id="webkit_safari_31_and_the_css_fontface_declaration">WebKit (Safari 3.1) and the <abbr title="Cascading Style Sheets">CSS</abbr> @font-face declaration</h1>
|
417
417
|
|
418
|
-
<p>I
|
418
|
+
<p>I’m a big fan of typography in general. If you check out <a href="http://elliottcable.name">my homepage</a> or my <a href="http://elliottcable.name/contact.xhtml">contact elliottcable</a> page, and you’re using Safari/WebKit or Opera/Kestrel, you’ll notice the typefaces (fonts, as colloquialized) are <em>very</em> non-standard. (As of this writing, I’m using <a href="http://www.josbuivenga.demon.nl/museo.html" title="Jos Buivenga's Museo free typeface">Museo</a> and <a href="http://www.josbuivenga.demon.nl/diavlo.html" title="Jos Buivenga's free Diavlo typeface">Diavlo</a><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> heavily on both.)</p>
|
419
419
|
|
420
|
-
<p>The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We
|
420
|
+
<p>The internet has not be a friendly place for typohiles like myself, up to this point, at least. One might even say it was a frightful, mentally scarring environment for those akin to yours truly. We’ve been restricted to reading page after page after page on day after day after day for year after year after year abominations of markup and design enslaved by the horrible overlords we know as Lucida, Verdana, Arial, Helvetica, Geneva, Georgia, Courier, and… dare I invoke ye, thou my terrible overlord? Times New Roman.</p>
|
421
421
|
|
422
422
|
<p>Wherefore art thou, my glorious Archer? And thee as well, my beautiful Garamond? The technical restrictions of that horrible monster we know as the Web Browser hath forced us all too long to use those most banal, those most common, and those most abused, out of all of the typefaces of the world.</p>
|
423
423
|
|
424
|
-
<p>All hyperbole aside, I
|
424
|
+
<p>All hyperbole aside, I’m extremely happy to see the advent of a standard <code>@font-face</code> declaration in <abbr title="Cascading Style Sheets">CSS</abbr>. Internet Explorer first implemented a crutched, basic version of this way back in version 4, but nothing ever really came of it - their decision to create the proprietary <abbr title="Embedded OpenType">.EOT</abbr><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> format to appease overly restrictive type foundries’ worries about intellectual property (aka. the cold, hard dominatrix that we know only as Ms. Profit) truly and completely killed that initial attempt at bringing astute typography and it’s advocates to the web. This new run at <code>@font-face</code> by an established, trusted, and open group (the <a href="http://w3c.org" title="World Wide Web Consortium"><abbr title="World Wide Web Consortium">W3C</abbr></a> itself, responsible for helping to make much of what we use as designers on the web standard and cross-system compatible) has a much better chance, in my humble opinion - and I am quite looking forward to the consequences if it succeeds.</p>
|
425
425
|
|
426
|
-
<p>Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it
|
426
|
+
<p>Now, onwards to the topic of my post as declared in the header (yes, I know, a slow start - but it’s an interesting topic with an interesting history!). WebKit, the open source rendering engine behind the wonderfulness that is Safari, and how it handles the ‘new’ <code>@font-face</code> declaration. No, it’s not really ‘new’, but yes, it feels like it is.</p>
|
427
427
|
|
428
|
-
<p>To put it simply, and to be very blunt, it
|
428
|
+
<p>To put it simply, and to be very blunt, it’s broken.</p>
|
429
429
|
|
430
430
|
<p>The <a href="http://?"><abbr title="Cascading Style Sheets">CSS</abbr> spec section</a> for <code>@font-face</code> is very specific - typefaces are to be selected based on a wide array of criteria placed in the <code>@font-face</code> declaration block itself. Various textual <abbr title="Cascading Style Sheets">CSS</abbr> attributes may be defined within the <code>@font-face</code> declaration, and then they will be checked when the typeface is referred to later in the <abbr title="Cascading Style Sheets">CSS</abbr>. For instance, if I have two <code>@font-face</code> declarations for the Diavlo family - one for regular text, and one for a heavier weighted version of the typeface - then I later utilize Diavlo in a <code>font-family:</code> attribute, it should refer to the basic Diavlo font defined in the first <code>@font-face</code>. However, if I were to do the same, but also specify a heavy <code>font-weight:</code>, then it should use the heavier version of Diavlo. To place this example in code:</p>
|
431
431
|
|
@@ -449,9 +449,9 @@ div#content {
|
|
449
449
|
font-family: 'Diavlo';
|
450
450
|
}</code></pre>
|
451
451
|
|
452
|
-
<p>As you can see, my headings should use the typeface defined in <code>Diavlo_Black.otf</code>, while my body content should use <code>Diavlo_Book.otf</code>. However, in WebKit, this doesn
|
452
|
+
<p>As you can see, my headings should use the typeface defined in <code>Diavlo_Black.otf</code>, while my body content should use <code>Diavlo_Book.otf</code>. However, in WebKit, this doesn’t work - it completely ignores any attribute except <code>font-family:</code> and <code>src:</code> in a <code>@font-face</code> declaration! Completely ignores them! Not only that - not <em>only</em> that - it disregards all but the last <code>@font-face</code> for a given <code>font-family:</code> attribute string!</p>
|
453
453
|
|
454
|
-
<p>The implication here is that, to make <code>@font-face</code> work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare <em>completely imaginary, non-existent type families</em> to satisfy WebKit alone. Here
|
454
|
+
<p>The implication here is that, to make <code>@font-face</code> work as it is currently implemented in WebKit (and thus, Safari 3.1), I have to declare <em>completely imaginary, non-existent type families</em> to satisfy WebKit alone. Here’s the method I have used in the places I current implement <code>@font-face</code>:</p>
|
455
455
|
|
456
456
|
<pre><code>@font-face {
|
457
457
|
font-family: 'Diavlo Book';
|
@@ -471,7 +471,7 @@ div#content {
|
|
471
471
|
font-family: 'Diavlo Book';
|
472
472
|
}</code></pre>
|
473
473
|
|
474
|
-
<p>Isn
|
474
|
+
<p>Isn’t it horrible? Seriously, my eyes, they bleed. There’s lots of problems with this far beyond the lack of semanticity when it comes to the typeface names… let me see how many ways this breaks the purpose of <code>@font-face</code>:</p>
|
475
475
|
|
476
476
|
<ul>
|
477
477
|
<li>
|
@@ -479,33 +479,33 @@ div#content {
|
|
479
479
|
|
480
480
|
<p>As soon as we begin to use <code>@font-face</code> in our page, we can no longer make any use of any other textual control attribute - <code>font-weight:</code>, <code>font-style:</code>, and <code>font-variant:</code> are no longer available to us, because they no longer correctly map to technical typeface variant/features.</p>
|
481
481
|
|
482
|
-
<p>Also, many default elements are destroyed, unusable, without
|
482
|
+
<p>Also, many default elements are destroyed, unusable, without ‘fixing’ - for instance, <code><b></code> would have no effect in a page styled for WebKit as above; We would have to specify something like <code>b {font-family: 'Diavlo Black';}</code> - how broken is that? Unless we caught all such default elements and re-styled them to use the bastardized names instead of the correct attributes, lots of basic HTML formatting would be broken. I myself may never use in-document formatting (separation of design and content!), but what about comments forms? Forum posts? Direct HTML-literal quotes?</p>
|
483
483
|
|
484
|
-
<p>If we want to use Javascript to modify the display of the content, we can
|
484
|
+
<p>If we want to use Javascript to modify the display of the content, we can’t simply adjust the mentioned textual control attributes - we have to know and change the entire <code>font-family:</code> array of strings.</p>
|
485
485
|
</li>
|
486
486
|
|
487
487
|
<li>
|
488
488
|
<p>You make us very wet.</p>
|
489
489
|
|
490
|
-
<p>And by wet, I mean
|
490
|
+
<p>And by wet, I mean ‘not <abbr title="Don't Repeat Yourself">DRY</abbr>’. What if we decide to change one of the bastardized font names? Or use a different font entirely? We have to go through all of our <abbr title="Cascading Style Sheets">CSS</abbr>, all of our Javascript, and make sure we update every occurrence of the typeface’s bastardized name.</p>
|
491
491
|
</li>
|
492
492
|
|
493
493
|
<li>
|
494
|
-
<p>You remove our user
|
494
|
+
<p>You remove our user’s user choice, and waste bandwidth.</p>
|
495
495
|
|
496
|
-
<p>Since the names refer to families that don
|
496
|
+
<p>Since the names refer to families that don’t, in fact, exist, the browser can’t override the declaration with a user’s installed version of the typeface. This means that, regardless of whether the user already has the typeface installed on their own computer, the browser won’t use that - it doesn’t know to use ‘Diavlo’, which the user has installed, because it was told to use ‘Diavlo Black’, which no user in the entire world has installed on their computer.</p>
|
497
497
|
</li>
|
498
498
|
</ul>
|
499
499
|
|
500
|
-
<p>This whole thing is rather worrying - I
|
500
|
+
<p>This whole thing is rather worrying - I’ve heard Opera has <code>@font-face</code> support, though I haven’t had time to test this myself, so I don’t know if it actually does - or, for that matter, if it does it ‘correctly’, or has the same problems as WebKit. But either way, WebKit is one of the first two implementations to ever attempt to support <code>@font-face</code> (Microsoft’s unrelated <code>@font-face</code> declaration notwithstanding) - I really don’t want to see it’s early mistakes carried on to FireFox in a few years, and then Internet Explorer a few decades after that. That will leave us stuck with this broken system forever, as it has been demonstrated time and time again that if nobody else supports an old standard correctly, a newcomer to the standard will not do it correctly either. I for one would really, really, hate that.</p>
|
501
501
|
|
502
|
-
<p>In summary
|
502
|
+
<p>In summary… come on, WebKit team, this isn’t like you - you’re always the ones with the closest-to-standard implementation, and the cleanest code, and… hell, overall? Webkit is the most secure/fastest browser available. But this is making me lose my faith in you, guys, please get it right. You’re pioneering a leap into the future when it comes to the Web - this is as important, or <em>more</em> important, than Mosiac’s allowing of images was.</p>
|
503
503
|
|
504
|
-
<p>To put it succinctly - don
|
504
|
+
<p>To put it succinctly - don’t fuck this up, y’all.</p>
|
505
505
|
<div class="footnotes"><hr /><ol><li id="fn:1">
|
506
|
-
<p>These are fonts by <a href="jos">Jos Buivenga</a>, quite the amazing person. His (free) fonts are, uniquely, released for use on the web in <code>@font-face</code> declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you
|
506
|
+
<p>These are fonts by <a href="jos">Jos Buivenga</a>, quite the amazing person. His (free) fonts are, uniquely, released for use on the web in <code>@font-face</code> declarations - unlike the vast majority of other (even free to download) typefaces, which have ridiculously restricting licenses and terms of use statements. Props, Jos - you’re a pioneer, and deserve recognition as such. <a href="#fnref:1" rev="footnote">↩</a></p>
|
507
507
|
</li><li id="fn:2">
|
508
|
-
<p>To give Microsoft a little credit, something I rarely do
|
508
|
+
<p>To give Microsoft a little credit, something I rarely do… Yes, I’m aware Microsoft submitted EOT to the <abbr title="World Wide Web Consortium">W3C</abbr> as a proposal - the problem isn’t with their attempts to make it non-proprietary, but with the basic concept of making typefaces on the web DRMed. Look what such attempts have done to the music and video industry - simply decimated it. Do we really want to see the same thing happen to our beloved medium as typography moves into the 21st century? <a href="#fnref:2" rev="footnote">↩</a></p>
|
509
509
|
</li></ol></div>
|
510
510
|
*** Output of to_latex ***
|
511
511
|
\hypertarget{webkit_safari_31_and_the_css_fontface_declaration}{}\section*{{WebKit (Safari 3.1) and the CSS @font-face declaration}}\label{webkit_safari_31_and_the_css_fontface_declaration}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Make sure extended attributes get escaped when generating HTML: https://github.com/bhollis/maruku/issues/114
|
2
|
+
*** Parameters: ***
|
3
|
+
{} # params
|
4
|
+
*** Markdown input: ***
|
5
|
+
*foo*{: style='ball & chain'}
|
6
|
+
|
7
|
+
*foo*{: style='ball\008 chain'}
|
8
|
+
|
9
|
+
*foo*{: style='ball\" badAttribute=\"chain'}
|
10
|
+
*** Output of inspect ***
|
11
|
+
md_el(:document, [
|
12
|
+
md_par(md_em("foo", [["style", "ball & chain"]])),
|
13
|
+
md_par(md_em("foo", [["style", "ball\\008 chain"]])),
|
14
|
+
md_par(md_em("foo", [["style", "ball\" badAttribute=\"chain"]]))
|
15
|
+
])
|
16
|
+
*** Output of to_html ***
|
17
|
+
<p><em style="ball & chain">foo</em>
|
18
|
+
</p>
|
19
|
+
<p><em style="ball\008 chain">foo</em>
|
20
|
+
</p>
|
21
|
+
<p><em style="ball" badAttribute="chain">foo</em>
|
22
|
+
</p>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
Adds CDATA only when necessary.
|
2
|
+
NOTE: CDATA is output because we use XHTML - for HTML mode it should be omitted.
|
3
|
+
*** Parameters: ***
|
4
|
+
{}
|
5
|
+
*** Markdown input: ***
|
6
|
+
<script>
|
7
|
+
var x = true && true;
|
8
|
+
</script>
|
9
|
+
|
10
|
+
<script>
|
11
|
+
var x = true;
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script>foo && bar</script>
|
15
|
+
|
16
|
+
<script>alert('foo');</script>
|
17
|
+
|
18
|
+
<style type="text/css">
|
19
|
+
p > .highlight {
|
20
|
+
color: red;
|
21
|
+
background-image: url('/foo?bar&baz');
|
22
|
+
}
|
23
|
+
</style>
|
24
|
+
|
25
|
+
<style type="text/css">
|
26
|
+
.highlight {
|
27
|
+
color: red;
|
28
|
+
}
|
29
|
+
</style>
|
30
|
+
*** Output of inspect ***
|
31
|
+
|
32
|
+
*** Output of to_html ***
|
33
|
+
<script>//<![CDATA[
|
34
|
+
var x = true && true;
|
35
|
+
//]]></script><script>
|
36
|
+
var x = true;
|
37
|
+
</script><script>//<![CDATA[
|
38
|
+
foo && bar
|
39
|
+
//]]></script><script>alert('foo');</script><style type='text/css'>/*<![CDATA[*/
|
40
|
+
p > .highlight {
|
41
|
+
color: red;
|
42
|
+
background-image: url('/foo?bar&baz');
|
43
|
+
}
|
44
|
+
/*]]>*/</style><style type='text/css'>
|
45
|
+
.highlight {
|
46
|
+
color: red;
|
47
|
+
}
|
48
|
+
</style>
|
@@ -19,10 +19,10 @@ h | h
|
|
19
19
|
md_el(:document,[
|
20
20
|
md_par(["hello"], [["summary", "Table summary"], [:class, "class1"], ["style", "color:red"]]),
|
21
21
|
md_el(:table,[
|
22
|
-
md_el(:head_cell,["h"],{},[]),
|
23
|
-
md_el(:head_cell,["h"],{},[]),
|
24
|
-
md_el(:cell,[" c1"],{},[[:ref, "t"]]),
|
25
|
-
md_el(:cell,["c2"],{},[])
|
22
|
+
[md_el(:head_cell,["h"],{},[]),
|
23
|
+
md_el(:head_cell,["h"],{},[])],
|
24
|
+
[md_el(:cell,[" c1"],{},[[:ref, "t"]]),
|
25
|
+
md_el(:cell,["c2"],{},[])]
|
26
26
|
],{:align=>[:left, :left]},[["summary", "Table summary"], [:class, "class1"], ["style", "color:red"]]),
|
27
27
|
md_el(:ald,[],{:ald=>[["scope", "row"]],:ald_id=>"t"},[])
|
28
28
|
],{},[])
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Codes which look like lists
|
2
|
+
*** Parameters: ***
|
3
|
+
{}
|
4
|
+
*** Markdown input: ***
|
5
|
+
|
6
|
+
This is code (4 spaces):
|
7
|
+
|
8
|
+
* Code
|
9
|
+
* Code (again)
|
10
|
+
|
11
|
+
This is also code
|
12
|
+
|
13
|
+
* Code
|
14
|
+
* Code (again)
|
15
|
+
|
16
|
+
This is code (1 tab):
|
17
|
+
|
18
|
+
* Code
|
19
|
+
* Code (again)
|
20
|
+
|
21
|
+
|
22
|
+
*** Output of inspect ***
|
23
|
+
md_el(:document,[
|
24
|
+
md_par(["This is code (4 spaces):"]),
|
25
|
+
md_el(:code,[],{:raw_code=>"* Code
|
26
|
+
* Code (again)", :lang=>nil},[]),
|
27
|
+
md_par(["This is also code"]),
|
28
|
+
md_el(:code,[],{:raw_code=>"* Code
|
29
|
+
* Code (again)", :lang=>nil},[]),
|
30
|
+
md_par(["This is code (1 tab):"]),
|
31
|
+
md_el(:code,[],{:raw_code=>"* Code
|
32
|
+
* Code (again)", :lang=>nil},[])
|
33
|
+
],{},[])
|
34
|
+
*** Output of to_html ***
|
35
|
+
<p>This is code (4 spaces):</p>
|
36
|
+
|
37
|
+
<pre><code>* Code
|
38
|
+
* Code (again)</code></pre>
|
39
|
+
|
40
|
+
<p>This is also code</p>
|
41
|
+
|
42
|
+
<pre><code>* Code
|
43
|
+
* Code (again)</code></pre>
|
44
|
+
|
45
|
+
<p>This is code (1 tab):</p>
|
46
|
+
|
47
|
+
<pre><code>* Code
|
48
|
+
* Code (again)</code></pre>
|
49
|
+
*** Output of to_latex ***
|
50
|
+
This is code (4 spaces):
|
51
|
+
|
52
|
+
\begin{verbatim}* Code
|
53
|
+
* Code (again)\end{verbatim}
|
54
|
+
This is also code
|
55
|
+
|
56
|
+
\begin{verbatim}* Code
|
57
|
+
* Code (again)\end{verbatim}
|
58
|
+
This is code (1 tab):
|
59
|
+
|
60
|
+
\begin{verbatim}* Code
|
61
|
+
* Code (again)\end{verbatim}
|
62
|
+
*** Output of to_md ***
|
63
|
+
This is code (4 spaces):
|
64
|
+
|
65
|
+
* Code
|
66
|
+
* Code (again)
|
67
|
+
|
68
|
+
This is also code
|
69
|
+
|
70
|
+
* Code
|
71
|
+
* Code (again)
|
72
|
+
|
73
|
+
This is code (1 tab):
|
74
|
+
|
75
|
+
* Code
|
76
|
+
* Code (again)
|
77
|
+
*** Output of to_s ***
|
78
|
+
This is code (4 spaces):This is also codeThis is code (1 tab):
|
79
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Handle blocks of block HTML without a newline. https://github.com/bhollis/maruku/issues/123
|
2
|
+
REXML won't clean up the HTML the way Nokogiri will...
|
3
|
+
*** Parameters: ***
|
4
|
+
{ }
|
5
|
+
*** Markdown input: ***
|
6
|
+
Heres some HTML.
|
7
|
+
<div>
|
8
|
+
Foo
|
9
|
+
</div>
|
10
|
+
*** Output of inspect ***
|
11
|
+
|
12
|
+
*** Output of to_html ***
|
13
|
+
<p>Heres some HTML.</p>
|
14
|
+
<div>
|
15
|
+
Foo
|
16
|
+
</div>
|
@@ -9,15 +9,9 @@ Write a comment here
|
|
9
9
|
*** Output of inspect ***
|
10
10
|
md_el(:document,[
|
11
11
|
md_el(:table,[
|
12
|
-
md_el(:head_cell,[],{},[]),
|
13
|
-
md_el(:
|
14
|
-
md_el(:
|
15
|
-
md_el(:cell,["A"],{},[]),
|
16
|
-
md_el(:cell,["X"],{},[]),
|
17
|
-
md_el(:cell,[],{},[]),
|
18
|
-
md_el(:cell,["B"],{},[]),
|
19
|
-
md_el(:cell,[],{},[]),
|
20
|
-
md_el(:cell,["X"],{},[])
|
12
|
+
[md_el(:head_cell,[],{},[]),md_el(:head_cell,["1"],{},[]),md_el(:head_cell,["2"],{},[])],
|
13
|
+
[md_el(:cell,["A"],{},[]),md_el(:cell,["X"],{},[]),md_el(:cell,[],{},[])],
|
14
|
+
[md_el(:cell,["B"],{},[]),md_el(:cell,[],{},[]),md_el(:cell,["X"],{},[])]
|
21
15
|
],{:align=>[:left, :left, :left]},[])
|
22
16
|
],{},[])
|
23
17
|
*** Output of to_html ***
|
data/spec/block_docs/entities.md
CHANGED
@@ -26,18 +26,12 @@ It should read like this: `©`.
|
|
26
26
|
md_el(:document,[
|
27
27
|
md_par(["Maruku translates HTML entities to the equivalent in LaTeX:"]),
|
28
28
|
md_el(:table,[
|
29
|
-
md_el(:head_cell,["Entity"],{},[]),
|
30
|
-
md_el(:
|
31
|
-
md_el(:cell,[md_code("&
|
32
|
-
md_el(:cell,[md_entity("
|
33
|
-
md_el(:cell,[md_code("&
|
34
|
-
md_el(:cell,[md_entity("
|
35
|
-
md_el(:cell,[md_code("a b")],{},[]),
|
36
|
-
md_el(:cell,["a", md_entity("nbsp"), "b"],{},[]),
|
37
|
-
md_el(:cell,[md_code("λ")],{},[]),
|
38
|
-
md_el(:cell,[md_entity("lambda")],{},[]),
|
39
|
-
md_el(:cell,[md_code("—")],{},[]),
|
40
|
-
md_el(:cell,[md_entity("mdash")],{},[])
|
29
|
+
[md_el(:head_cell,["Entity"],{},[]),md_el(:head_cell,["Result"],{},[])],
|
30
|
+
[md_el(:cell,[md_code("©")],{},[]),md_el(:cell,[md_entity("copy")],{},[])],
|
31
|
+
[md_el(:cell,[md_code("£")],{},[]),md_el(:cell,[md_entity("pound")],{},[])],
|
32
|
+
[md_el(:cell,[md_code("a b")],{},[]),md_el(:cell,["a", md_entity("nbsp"), "b"],{},[])],
|
33
|
+
[md_el(:cell,[md_code("λ")],{},[]),md_el(:cell,[md_entity("lambda")],{},[])],
|
34
|
+
[md_el(:cell,[md_code("—")],{},[]),md_el(:cell,[md_entity("mdash")],{},[])]
|
41
35
|
],{:align=>[:left, :left]},[]),
|
42
36
|
md_par([
|
43
37
|
"Entity-substitution does not happen in code blocks or inline code."
|
@@ -12,12 +12,12 @@ Content Cell | Content Cell
|
|
12
12
|
*** Output of inspect ***
|
13
13
|
md_el(:document,[
|
14
14
|
md_el(:table,[
|
15
|
-
md_el(:head_cell,["First Header"],{},[]),
|
16
|
-
md_el(:head_cell,["Second Header"],{},[]),
|
17
|
-
md_el(:cell,["Content Cell"],{},[]),
|
18
|
-
md_el(:cell,["Content Cell"],{},[]),
|
19
|
-
md_el(:cell,["Content Cell"],{},[]),
|
20
|
-
md_el(:cell,["Content Cell"],{},[])
|
15
|
+
[md_el(:head_cell,["First Header"],{},[]),
|
16
|
+
md_el(:head_cell,["Second Header"],{},[])],
|
17
|
+
[md_el(:cell,["Content Cell"],{},[]),
|
18
|
+
md_el(:cell,["Content Cell"],{},[])],
|
19
|
+
[md_el(:cell,["Content Cell"],{},[]),
|
20
|
+
md_el(:cell,["Content Cell"],{},[])]
|
21
21
|
],{:align=>[:left, :left]},[])
|
22
22
|
],{},[])
|
23
23
|
*** Output of to_html ***
|
@@ -31,36 +31,28 @@ john = Twitter::Client.new(
|
|
31
31
|
~~~~~
|
32
32
|
*** Output of inspect ***
|
33
33
|
md_el(:document, [
|
34
|
-
md_el(:code, [], {:raw_code=>"
|
35
|
-
md_el(:code, [], {:raw_code=>"
|
36
|
-
md_el(:code, [], {:raw_code=>"
|
37
|
-
md_el(:code, [], {:raw_code=>"
|
34
|
+
md_el(:code, [], {:raw_code=>"john = Twitter::Client.new(\n :oauth_token => \"John's access token\",\n :oauth_token_secret => \"John's access secret\"\n)", :lang=>"ruby"}),
|
35
|
+
md_el(:code, [], {:raw_code=>"john = Twitter::Client.new(\n :oauth_token => \"John's access token\",\n :oauth_token_secret => \"John's access secret\"\n)", :lang=>nil}),
|
36
|
+
md_el(:code, [], {:raw_code=>"john = Twitter::Client.new(\n :oauth_token => \"John's access token\",\n :oauth_token_secret => \"John's access secret\"\n)", :lang=>"ruby"}),
|
37
|
+
md_el(:code, [], {:raw_code=>"john = Twitter::Client.new(\n :oauth_token => \"John's access token\",\n :oauth_token_secret => \"John's access secret\"\n)", :lang=>nil})
|
38
38
|
])
|
39
39
|
*** Output of to_html ***
|
40
|
-
<pre class="ruby"><code class="ruby">
|
41
|
-
john = Twitter::Client.new(
|
40
|
+
<pre class="ruby"><code class="ruby">john = Twitter::Client.new(
|
42
41
|
:oauth_token => "John's access token",
|
43
42
|
:oauth_token_secret => "John's access secret"
|
44
|
-
)
|
45
|
-
</code></pre>
|
43
|
+
)</code></pre>
|
46
44
|
|
47
|
-
<pre><code>
|
48
|
-
john = Twitter::Client.new(
|
45
|
+
<pre><code>john = Twitter::Client.new(
|
49
46
|
:oauth_token => "John's access token",
|
50
47
|
:oauth_token_secret => "John's access secret"
|
51
|
-
)
|
52
|
-
</code></pre>
|
48
|
+
)</code></pre>
|
53
49
|
|
54
|
-
<pre class="ruby"><code class="ruby">
|
55
|
-
john = Twitter::Client.new(
|
50
|
+
<pre class="ruby"><code class="ruby">john = Twitter::Client.new(
|
56
51
|
:oauth_token => "John's access token",
|
57
52
|
:oauth_token_secret => "John's access secret"
|
58
|
-
)
|
59
|
-
</code></pre>
|
53
|
+
)</code></pre>
|
60
54
|
|
61
|
-
<pre><code>
|
62
|
-
john = Twitter::Client.new(
|
55
|
+
<pre><code>john = Twitter::Client.new(
|
63
56
|
:oauth_token => "John's access token",
|
64
57
|
:oauth_token_secret => "John's access secret"
|
65
|
-
)
|
66
|
-
</code></pre>
|
58
|
+
)</code></pre>
|
@@ -11,8 +11,7 @@ john = Twitter::Client.new(
|
|
11
11
|
*** Output of inspect ***
|
12
12
|
|
13
13
|
*** Output of to_html ***
|
14
|
-
<pre class="ruby"><code class="ruby">
|
15
|
-
<span class="ident">john</span> <span class="punct">=</span> <span class="constant">Twitter</span><span class="punct">::</span><span class="constant">Client</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span>
|
14
|
+
<pre class="ruby"><code class="ruby"><span class="ident">john</span> <span class="punct">=</span> <span class="constant">Twitter</span><span class="punct">::</span><span class="constant">Client</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span>
|
16
15
|
<span class="symbol">:oauth_token</span> <span class="punct">=></span> <span class="punct">"</span><span class="string">John's access token</span><span class="punct">",</span>
|
17
16
|
<span class="symbol">:oauth_token_secret</span> <span class="punct">=></span> <span class="punct">"</span><span class="string">John's access secret</span><span class="punct">"</span>
|
18
17
|
<span class="punct">)</span></code></pre>
|