---
title:"test"author:"me"date:"07.10.2014"output: html_document
---
This is a simple test document. It shows syntax highlighting switches between YAML (above), R blocks
```{r, echo=FALSE}for (i in1:10) {
if(i>=10) print(i)
}
# two blank lines belowsessionInfo()
```
LaTeX equations,
$$h_{i}(t \mid q,C) = h_{0}(t) e^{\beta_{1}quality_{i} + \beta_{2}C_{iq}}$$
-and Markdown. A [link](http://example.com) in Markdown.
+and Markdown. A [link](http://example.com) in Markdown.
Inline `r y <-5 +x -sin(3)` R code.
Inline `y <- 5 + x - sin(3)` code.
Heading
- =======
+ =======
Sub-heading
-----------
A list of editors:
- * kate
- * vim
- * emacs
+ * kate
+ * vim
+ * emacs
-*italic*, **bold**,`monospace`
+*italic*, **bold**, `monospace`
+
+ code block
+ more code
+
+normal text
+ normal text
+ normal text
+
+1. item
+ * This is a list item
+ with multiple lines.
+
+ ```{r pressure, echo=FALSE}
+ plot(pressure)
+ ```
+
+ > This is a
+ blockquote `rcos(33) `
+
+ This is a new paragraph, which
+ is part of this $$\text{item}$$.
+
+ indented code block
+
+ Other paragraph.
+
+ * subitem
+ * subitem
+ $$ A = B + C $$
+{{/movie}}
+```
+
+## Perl
+
+```perl
+my $var = shift;
+
+$var =~ s/bla/foo/igs;
+$var =~ s!bla!foo!igs;
+$var =~ s#bla#foo#igs;
```
## PHP
```php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
class IndexController extends AbstractActionController
{
}
```
## Python
```python
def addXToY(x, y):
total = x + y
print total
```
## QML
```qml
Text {
id: hello
width: 100
text: "Hello world!"
}
```
+## R
+
+```r
+# Declare function “f” with parameters “x”, “y“
+# that returns a linear combination of x and y.
+f <- function(x, y) {
+ z <- 3 * x + 4 * y
+ return(z)
+}
+```
+
+## Ruby
+
+```ruby
+require 'Config'
+ def CGI::escape(string)
+ string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
+ '%' + $1.unpack('H2' * $1.size).join('%').upcase
+ end.tr(' ', '+')
+ end
+```
+
## Rust
```rust
fn main() {
println!("Hello world!");
}
```
+## MySQL
+
+```mysql
+-- comment
+CREATE TABLE stuff COLUMNS(col1 INT, col2 Varchar);
+SELECT * FROM stuff WHERE id = 'string';
+select * from stuff where id < 0.42;
+Select col1, col2 From stuff Where stuff.col1 IS NOT NuLL;
+```
+
+## TypeScript
+
+```ts
+class Student {
+ fullName: string;
+ constructor(public firstName: string, public middleInitial: string, public lastName: string) {
+ this.fullName = firstName + " " + middleInitial + " " + lastName;
+ }
+}
+```
+
## XML
```xml
```
+## reStructuredText
+
+```rst
+Section Header
+==============
+
+.. image:: /path/to/image.jpg
+
+- A bullet list item
+```
+
+## Doxygen
+
+```doxygen
+a normal member taking two arguments and returning an integer value.
+@param a an integer argument.
+@param s a constant character pointer.
+@see Javadoc_Test()
+@see publicVar()
+@return The test results
+```
+
## No language specified
```
No language is specified, but it should be still rendered as code block.
```
+
+# Fenced code blocks with more than 3 backticks or tildes
+
+~~~
+Fenced code block with 3 tildes.
+~~~
+
+`````````
+Some implementations of Markdown/MultiMarkdown support more than 3 backticks or tildes.
+```
+The block ends with the same amount of backticks.
+`````````
+
+~~~~~~~~~~~~
+Fenced code block with more tildes.
+~~~~~~~~~~~~
+
+## With languages
+
+```````html
+
+
+
Hello world!
+
+
+```
+```````
+
+~~~bash
+for f in *; do
+ echo "$f"
+done
+~~~
+
+~~~~~~~~~python
+def addXToY(x, y):
+ total = x + y
+ print total
+~~~ # <= doesn't end here
+~~~~~~~~~
+
+# Italic and bold text
+
+**b** *i* __b__ _i_
+***ib*** ___ib___
+**_ib_** __*ib*__
+
+* _italic_ **bold** ***ib*** ~~strikeout~~
+
+> _italic_ **bold** ***ib*** ~~strikeout~~
+
+## Bold
+**bold*___text** normal
+__bold_***text__ normal
+
+## Italic
+*italic _ text* normal
+_italic * text_ normal
+
+## Italic-Bold
+***italic-bold ** italic-bold*** normal
+***bold-italic text **bold-italic text*** normal
+***bold*italic*** normal
+**_bold-italic text_** normal
+
+
+_ normal text_ * normal text *
+*italic text*normal text*
+*italic text *italic text*
+**bold text**normal text**
+**bold text **bold text**
+
+
+aaa**bold text**aaaaa
+aaa__normal text__aaaaa
+пристаням_стремятся_
+
+
+\*normal text*
+_normal text\_
+**italic text\**
+***only bold\***
+**bold\** bold**
diff --git a/autotests/reference/basic.markdown.ref b/autotests/reference/basic.markdown.ref
index 8f32c5d..4b98853 100644
--- a/autotests/reference/basic.markdown.ref
+++ b/autotests/reference/basic.markdown.ref
@@ -1,6 +1,6 @@
normal
-* item1
-still part of item
-
+* item1
+still part of item
+ normal text again
diff --git a/autotests/reference/example.rmd.ref b/autotests/reference/example.rmd.ref
index 8f4fa3c..3273990 100644
--- a/autotests/reference/example.rmd.ref
+++ b/autotests/reference/example.rmd.ref
@@ -1,39 +1,68 @@
--- title:"test" author:"me" date:"07.10.2014" output: html_document --- This is a simple test document. It shows syntax highlighting switches between YAML (above), R blocks ```{r, echo=FALSE} for(i in1:10){ if(i>=10)print(i) } # two blank lines below sessionInfo() ``` LaTeX equations, $$ \mid\beta\beta $$
-and Markdown. A [link](http://example.com) in Markdown.
+and Markdown. A [link](http://example.com) in Markdown. Inline `r y <-5+x -sin(3)` R code.
-Inline `y <- 5 + x - sin(3)` code.
+Inline `y <- 5 + x - sin(3)` code. Heading
- =======
+======= Sub-heading
- -----------
+ ----------- A list of editors:
- * kate
- * vim
- * emacs
+ * kate
+ * vim
+ * emacs
+
+*italic*, **bold**, `monospace`
-*italic*, **bold**,`monospace`
+ code block
+ more code
+
+normal text
+ normal text
+ normal text
+
+1. item
+ * This is a list item
+ with multiple lines.
+
+```{r pressure, echo=FALSE}
+plot(pressure)
+```
+
+
>
This is a
+ blockquote `rcos(33)`
+
+ This is a new paragraph, which
+ is part of this $$\text{item}$$.
+
+ indented code block
+
+ Other paragraph.
+
+ * subitem
+ * subitem
+$$$$
diff --git a/autotests/reference/test.markdown.ref b/autotests/reference/test.markdown.ref
index fdf2e1e..10c0843 100644
--- a/autotests/reference/test.markdown.ref
+++ b/autotests/reference/test.markdown.ref
@@ -1,182 +1,582 @@
-
# H1
+---
+Title: A Sample Markdown Document
+Author: Fletcher T. Penney
+Date: February 9, 2011
+Comment: This is a comment intended to demonstrate
+ metadata that spans multiple lines.
+---
-
## H2
+# H1
-
### H3
+## H2
+
+### H3 Multi-line paragraph bla bla bla bla bla bla.
-Intentional line break
+Intentional line break via two spaces at line.
-Formats: _italic_, **bold**,`monospace`, ~~strikeout~~
+Formats: _italic_, **bold**, `monospace`, ~~strikeout~~ Bullet list:
-* item1
-* item2
-
+* item1
+* item2
+ Numbered list:
-1. item 1
-2. item 2
+1. item 1
+2. item 2
+
+Task list:
-[link](http://kde.org)
+- [x] Finish my changes
+- [ ] Push my commits
+- [ ] Open a pull request
+
+A link as normal text: http://example.com
- code 1
- code 2
+[link](http://kde.org)
-normal text
+Auto-link: <http://kate-editor.org>
+Mail: mark@kde.org>
+
+This is [an example](http://example.com/ "Title") inline link.
+
+See my [About](/about/) page for details.
+
+This is [an example] [id] reference-style link.
+
+[id]: http://example.com/ "Optional Title Here"
+[foo]: http://example.com/ 'Optional Title Here'
+[bar]: http://example.com/ (Optional Title Here)
+[id2]: <http://example.com/> "Optional Title Here"
+
+![Alt text](/path/to/img.jpg)
+
+![Alt text](/path/to/img.jpg "Optional title")
-
> block quote
_italic_
-
> more block quote
+[![Alt text](https://url/to/img.svg)](https://link.com/example/)
+
+ code 1
+ code 2 normal text
-Title: some text
+
>
block quote _italic_
+
>
more block quote normal text
-
# Fenced code blocks (bug 356974)
+Title: some text
+
+normal text
-
## Bash
+# Lists
+
+1. item
+ * This is a list item
+ with multiple lines.
+```
+ code
+```
+
+
>
This is a
+ blockquote
+
+ This is a new paragraph, which
+ is part of the item in the
+ previous list.
+
+ indented code block
+
+ Other paragraph.
+
+ * subitem
+ * subitem
+ with multiple
+ lines.
+
+ New paragraph of
+ the previous subitem.
+
+ code block
+
+ -----------------------
+
+ Other paragraph of
+ the subitem.
+
+ 30. numlist item
+ 31. numlist item
+
+ New paragraph of
+ the previous item.
+
+
+
+normal text *italic*
+
+# Code
+
+`simple code`
+
+``simple ` code``
+
+```simple `` ` code ```
+
+````simple`code````
-```bash
+normal text
+ normal text
+ normal text
+ normal text
+
+ code blocks are only allowed
+ after an empty line.
+
+* list
+ list
+
+ normal text
+
+1. num-list
+ num-list
+
+ normal text
+
+
+## R
+
+```r
+# Declare function “f” with parameters “x”, “y“
+# that returns a linear combination of x and y.
+f <-function(x, y){
+ z <-3*x +4*y
+return(z)
+}
+```
-```rust
+## Ruby
+
+```ruby
+require'Config'
+defCGI::escape(string)
+ string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
+'%'+$1.unpack('H2'*$1.size).join('%').upcase
+end.tr(' ', '+')
+end
+```
+
+## Rust
+
+```rust fn main() { println!("Hello world!"); }
-```
+```
+
+## MySQL
+
+```mysql
+-- comment
+CREATETABLE stuff COLUMNS(col1 INT, col2 Varchar);
+SELECT*FROM stuff WHERE id ='string';
+select*from stuff where id <0.42;
+Select col1, col2 From stuff Where stuff.col1 ISNOTNuLL;
+```
+
+## TypeScript
+
+```ts
+classStudent {
+fullName:string;
+constructor(publicfirstName:string,publicmiddleInitial:string,publiclastName:string) {
+this.=firstName +" "+middleInitial +" "+lastName;
+}
+}
+```
-
## XML
+## XML
-```xml
+```xml attribute="3">
-```
+```
+
+## reStructuredText
+
+```rst
+Section Header
+==============
+
+.. image:: /path/to/image.jpg
+
+- A bullet list item
+```
+
+## Doxygen
+
+```doxygen
+a normal member taking two arguments and returning an integer value.
+@parama an integer argument.
+@params a constant character pointer.
+@see Javadoc_Test()
+@see publicVar()
+@return The test results
+```
+
+## No language specified
+
+```
+No language is specified, but it should be still rendered as code block.
+```
-
## No language specified
+# Fenced code blocks with more than 3 backticks or tildes
-```
-No language is specified, but it should be still rendered as code block.
-```
+~~~
+Fenced code block with 3 tildes.
+~~~
+
+`````````
+Some implementations of Markdown/MultiMarkdown support more than 3 backticks or tildes.
+```
+The block ends with the same amount of backticks.
+`````````
+
+~~~~~~~~~~~~
+Fenced code block with more tildes.
+~~~~~~~~~~~~
+
+## With languages
+
+```````html
+
+
+
class="main">Hello world!
+
+
+```
+```````
+
+~~~bash
+forf *;do
+echo"$f"
+done
+~~~
+
+~~~~~~~~~python
+def addXToY(x, y):
+ total = x + y
+print total
+~~~# <= doesn't end here
+~~~~~~~~~
+
+# Italic and bold text
+
+**b***i*__b___i_
+***ib***___ib___
+**_ib_**__*ib*__
+
+* _italic_**bold*****ib***~~strikeout~~
+
+