diff --git a/autotests/folding/test.markdown.fold b/autotests/folding/test.markdown.fold --- a/autotests/folding/test.markdown.fold +++ b/autotests/folding/test.markdown.fold @@ -40,26 +40,141 @@ # Fenced code blocks (bug 356974) +## Bash + +```bash +#!/usr/bin/env bash + +for f in *; do + echo "$f" +done +``` + +## C++ + +```cpp +#include + +class Q : public QObject { +Q_OBJECT +public: + Q(); +} + +Q::Q() :QObject(NULL) { +} +``` + +## CMake + +```cmake +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + +project (hello_world) + +set(QT_MIN_VERSION "5.6.0") +``` + +## CSS + +```css +h1.main::hover { + font-size: 100; + color: green; +} +``` + +## Email + +```email +From: Konqi Dragon +To: All +Subject: highlights +``` + +## Haskell + +```haskell +module Main (main) where + +main :: IO () +main = putStrLn "Hello, World!" +``` + +## HTML + +```html + + +

Hello world!

+ + +``` + +## JSON + +```json +[{ + "hello": "world", + "count": 1, + "bool": true +}] +``` + +## KConfig + +```kconfig +[General] +Toggle=true +Count=1 +``` + ## PHP ```php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; class IndexController extends AbstractActionController -{ -} +{ +} ``` ## Python ```python -def addXToY(x, y): +def addXToY(x, y): total = x + y print total ``` +## QML + +```qml +Text { + id: hello + width: 100 + text: "Hello world!" +} +``` + +## Rust + +```rust +fn main() { + println!("Hello world!"); +} +``` + +## XML + +```xml + attribute="3"> + /> +> +``` + ## No language specified ``` diff --git a/autotests/html/test.markdown.html b/autotests/html/test.markdown.html --- a/autotests/html/test.markdown.html +++ b/autotests/html/test.markdown.html @@ -46,6 +46,95 @@ # Fenced code blocks (bug 356974) +## Bash + +```bash +#!/usr/bin/env bash + +for f in *; do + echo "$f" +done +``` + +## C++ + +```cpp +#include <QtCore/QObject> + +class Q : public QObject { +Q_OBJECT +public: + Q(); +} + +Q::Q() :QObject(NULL) { +} +``` + +## CMake + +```cmake +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + +project (hello_world) + +set(QT_MIN_VERSION "5.6.0") +``` + +## CSS + +```css +h1.main::hover { + font-size: 100; + color: green; +} +``` + +## Email + +```email +From: Konqi Dragon <konqi@kde.org> +To: All <all@kde.og> +Subject: highlights +``` + +## Haskell + +```haskell +module Main (main) where + +main :: IO () +main = putStrLn "Hello, World!" +``` + +## HTML + +```html +<html> + <body> + <p class="main">Hello world!</p> + </body> +</html> +``` + +## JSON + +```json +[{ + "hello": "world", + "count": 1, + "bool": true +}] +``` + +## KConfig + +```kconfig +[General] +Toggle=true +Count=1 +``` + ## PHP ```php @@ -66,6 +155,32 @@ print total ``` +## QML + +```qml +Text { + id: hello + width: 100 + text: "Hello world!" +} +``` + +## Rust + +```rust +fn main() { + println!("Hello world!"); +} +``` + +## XML + +```xml +<tag attribute="3"> + <nested/> +</tag> +``` + ## No language specified ``` diff --git a/autotests/input/test.markdown b/autotests/input/test.markdown --- a/autotests/input/test.markdown +++ b/autotests/input/test.markdown @@ -40,6 +40,95 @@ # Fenced code blocks (bug 356974) +## Bash + +```bash +#!/usr/bin/env bash + +for f in *; do + echo "$f" +done +``` + +## C++ + +```cpp +#include + +class Q : public QObject { +Q_OBJECT +public: + Q(); +} + +Q::Q() :QObject(NULL) { +} +``` + +## CMake + +```cmake +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + +project (hello_world) + +set(QT_MIN_VERSION "5.6.0") +``` + +## CSS + +```css +h1.main::hover { + font-size: 100; + color: green; +} +``` + +## Email + +```email +From: Konqi Dragon +To: All +Subject: highlights +``` + +## Haskell + +```haskell +module Main (main) where + +main :: IO () +main = putStrLn "Hello, World!" +``` + +## HTML + +```html + + +

Hello world!

+ + +``` + +## JSON + +```json +[{ + "hello": "world", + "count": 1, + "bool": true +}] +``` + +## KConfig + +```kconfig +[General] +Toggle=true +Count=1 +``` + ## PHP ```php @@ -60,6 +149,32 @@ print total ``` +## QML + +```qml +Text { + id: hello + width: 100 + text: "Hello world!" +} +``` + +## Rust + +```rust +fn main() { + println!("Hello world!"); +} +``` + +## XML + +```xml + + + +``` + ## No language specified ``` diff --git a/autotests/reference/test.markdown.ref b/autotests/reference/test.markdown.ref --- a/autotests/reference/test.markdown.ref +++ b/autotests/reference/test.markdown.ref @@ -40,6 +40,95 @@

# Fenced code blocks (bug 356974)



+

## Bash


+
+```bash
+#!/usr/bin/env bash
+
+for f *; do
+ echo "$f"
+done
+```
+
+

## C++


+
+```cpp
+#include
+
+class Q : public QObject {
+Q_OBJECT
+public:
+ Q();
+}
+
+Q::Q() :QObject(NULL) {
+}
+```
+
+

## CMake


+
+```cmake
+cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
+
+project (hello_world)
+
+set(QT_MIN_VERSION "5.6.0")
+```
+
+

## CSS


+
+```css
+h1.main::hover {
+ font-size: 100;
+ color: green;
+}
+```
+
+

## Email


+
+```email
+From: Konqi Dragon

+To: All

+Subject: highlights
+```
+
+

## Haskell


+
+```haskell
+module Main (main) where
+
+main :: IO ()
+main = putStrLn "Hello, World!"
+```
+
+

## HTML


+
+```html
+
+
+ class="main">Hello world!


+
+
+```
+
+

## JSON


+
+```json
+[{
+ "hello": "world",
+ "count": 1,
+ "bool": true
+}]
+```
+
+

## KConfig


+
+```kconfig
+[General]
+Toggle=true
+Count=1
+```
+

## PHP



```php
@@ -60,6 +149,32 @@ print total
```

+

## QML


+
+```qml
+Text {
+ id: hello
+ width: 100
+ text: "Hello world!"
+}
+```
+
+

## Rust


+
+```rust
+fn main() {
+ println!("Hello world!");
+}
+```
+
+

## XML


+
+```xml
+ attribute="3">
+
+
+```
+

## No language specified



```
diff --git a/data/syntax/markdown.xml b/data/syntax/markdown.xml --- a/data/syntax/markdown.xml +++ b/data/syntax/markdown.xml @@ -35,7 +35,7 @@ ]> - + @@ -74,14 +74,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -98,8 +146,19 @@ + + + + + + + + + + +