Warning, /frameworks/syntax-highlighting/autotests/input/test.markdown is written in an unsupported language. File is not indexed.
0001 --- 0002 Title: A Sample Markdown Document 0003 Author: Fletcher T. Penney 0004 Date: February 9, 2011 0005 Comment: This is a comment intended to demonstrate 0006 metadata that spans multiple lines. 0007 --- 0008 0009 # H1 0010 0011 ## H2 0012 0013 ### H3 0014 0015 Multi-line paragraph bla bla bla 0016 bla bla bla. 0017 0018 Intentional line break 0019 via two spaces at line. 0020 0021 Formats: _italic_, **bold**, `monospace`, ~~strikeout~~, ==highlight== 0022 0023 Emoji: :joy: :+1: 0024 0025 Table: 0026 0027 | Syntax | Description | Test Text | Note | 0028 | :--- | :----: | ---: | ---- | 0029 | Header | Title | \| this | | 0030 0031 Bullet list: 0032 0033 * item1 0034 * item2 0035 0036 Numbered list: 0037 0038 1. item 1 0039 2. item 2 0040 0041 Task list: 0042 0043 - [x] Finish my changes 0044 - [ ] Push my commits 0045 - [ ] Open a pull request 0046 0047 A link as normal text: http://example.com 0048 0049 [link](http://kde.org) 0050 0051 Auto-link: <http://kate-editor.org> 0052 Mail: <mailto:mark@kde.org> 0053 0054 This is [an example](http://example.com/ "Title") inline link. 0055 0056 See my [About](/about/) page for details. 0057 0058 This is [an example] [id] reference-style link. 0059 0060 [id]: http://example.com/ "Optional Title Here" 0061 [foo]: http://example.com/ 'Optional Title Here' 0062 [bar]: http://example.com/ (Optional Title Here) 0063 [id2]: <http://example.com/> "Optional Title Here" 0064 0065 ![Alt text](/path/to/img.jpg) 0066 0067 ![Alt text](/path/to/img.jpg "Optional title") 0068 0069 [![Alt text](https://url/to/img.svg)](https://link.com/example/) 0070 0071 code 1 0072 code 2 0073 0074 normal text 0075 0076 > block quote _italic_ 0077 > more block quote 0078 0079 normal text 0080 0081 Title: some text 0082 0083 normal text 0084 0085 # Lists 0086 0087 1. item 0088 * This is a list item 0089 with multiple lines. 0090 ``` 0091 code 0092 ``` 0093 0094 > This is a 0095 blockquote 0096 0097 This is a new paragraph, which 0098 is part of the item in the 0099 previous list. 0100 0101 indented code block 0102 0103 Other paragraph. 0104 0105 * subitem 0106 * subitem 0107 with multiple 0108 lines. 0109 0110 New paragraph of 0111 the previous subitem. 0112 0113 code block 0114 0115 ----------------------- 0116 0117 Other paragraph of 0118 the subitem. 0119 0120 30. numlist item 0121 31. numlist item 0122 0123 New paragraph of 0124 the previous item. 0125 0126 > Blockquote 0127 0128 code block 0129 0130 Other paragraph. 0131 0132 # Inline HTML 0133 0134 © 0135 <strong>bold</strong> 0136 <code>code</code> 0137 0138 <table> 0139 <tr> 0140 <th>a</th> 0141 <th>b</th> 0142 </tr> 0143 <tr> 0144 <th><ul> 0145 <li>c</li> 0146 <li>d</li> 0147 </ul></th> 0148 <th>e</th> 0149 </tr> 0150 </table> 0151 0152 normal text *italic* 0153 0154 # Code 0155 0156 `simple code` 0157 0158 ``simple ` code`` 0159 0160 ```simple `` ` code ``` 0161 0162 ````simple`code```` 0163 0164 normal text 0165 normal text 0166 normal text 0167 normal text 0168 0169 code blocks are only allowed 0170 after an empty line. 0171 0172 * list 0173 list 0174 0175 normal text 0176 0177 1. num-list 0178 num-list 0179 0180 normal text 0181 0182 > quote 0183 quote 0184 0185 code block 0186 0187 normal 0188 <!-- comment --> 0189 <!-- code, not comment --> 0190 code 0191 0192 normal 0193 0194 <!-- coment --> 0195 code 0196 0197 # Fenced code blocks (bug 356974) 0198 0199 ## Bash 0200 0201 ```bash 0202 #!/usr/bin/env bash 0203 0204 for f in *; do 0205 echo "$f" 0206 done 0207 ``` 0208 0209 ## C++ 0210 0211 ```cpp 0212 #include <QtCore/QObject> 0213 0214 class Q : public QObject { 0215 Q_OBJECT 0216 public: 0217 Q(); 0218 } 0219 0220 Q::Q() :QObject(NULL) { 0221 } 0222 ``` 0223 0224 ## C 0225 0226 ```c 0227 #include <stdio.h> 0228 #include "stdint.h" 0229 #define SOME_VAR 1 0230 0231 static uint64_t intWithSuffix = 42ull + ~1233L; 0232 static int octNum = 07232; 0233 ``` 0234 0235 ## C# ## 0236 0237 ```csharp 0238 var arr = new[] { 0, 1, 2, 3, 4 }; 0239 var anon = new { Country = "Germany", Inhabitants = 80000000 }; 0240 ``` 0241 0242 ## CMake 0243 0244 ```cmake 0245 cmake_minimum_required(VERSION 3.10 FATAL_ERROR) 0246 0247 project (hello_world) 0248 0249 set(QT_MIN_VERSION "5.6.0") 0250 ``` 0251 0252 ## CSS 0253 0254 ```css 0255 h1.main::hover { 0256 font-size: 100; 0257 color: green; 0258 } 0259 ``` 0260 0261 ## Email 0262 0263 ```email 0264 From: Konqi Dragon <konqi@kde.org> 0265 To: All <all@kde.og> 0266 Subject: highlights 0267 ``` 0268 0269 ## Go 0270 0271 ```go 0272 package main 0273 0274 import "fmt" 0275 0276 func main() { 0277 fmt.Println("Hola, mundo.") 0278 } 0279 ``` 0280 0281 ## Haskell 0282 0283 ```haskell 0284 module Main (main) where 0285 0286 main :: IO () 0287 main = putStrLn "Hello, World!" 0288 ``` 0289 0290 ## HTML 0291 0292 ```html 0293 <html> 0294 <body> 0295 <p class="main">Hello world!</p> 0296 </body> 0297 </html> 0298 ``` 0299 0300 ## Java 0301 0302 ```java 0303 package fibsandlies; 0304 import java.util.HashMap; 0305 0306 /** 0307 * This is an example of a Javadoc comment; Javadoc can compile documentation 0308 * from this text. Javadoc comments must immediately precede the class, method, or field being documented. 0309 */ 0310 public class FibCalculator extends Fibonacci implements Calculator { 0311 0312 private static Map<Integer, Integer> memoized = new HashMap<Integer, Integer>(); 0313 public static void main(String[] args) { 0314 memoized.put(1, 1); 0315 memoized.put(2, 1); 0316 System.out.println(fibonacci(12)); 0317 } 0318 } 0319 ``` 0320 0321 ## JavaScript 0322 0323 ```js 0324 function factorial(n) { 0325 if (n === 0) { 0326 return 1; // 0! = 1 0327 } 0328 return n * factorial(n - 1); 0329 } 0330 ``` 0331 0332 ## JavaScript React (JSX) 0333 0334 ```jsx 0335 <hello /> 0336 function Story(props) { 0337 const SpecificStory = components[props.storyType]; 0338 return <SpecificStory story={ props.story } attr2="&ref;" attr3="Hello\n" />; 0339 } 0340 ``` 0341 0342 ## JSON 0343 0344 ```json 0345 [{ 0346 "hello": "world", 0347 "count": 1, 0348 "bool": true 0349 }] 0350 ``` 0351 0352 ## Matlab 0353 0354 ```matlab 0355 % Numbers _____________________________________________ 0356 5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i 0357 5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i' 0358 ``` 0359 0360 ## Markdown 0361 0362 ```markdown 0363 **bold** `code` 0364 > quote 0365 0366 ``` 0367 0368 ## Mustache/Handlebars 0369 0370 ```handlebars 0371 {{#movie}} 0372 <div> 0373 <h1>{{title}}</h1> 0374 <img src="{{poster}}" alt="{{title}}"/> 0375 </div> 0376 <div> 0377 Rating - {{ratings.critics_rating}} 0378 </div> 0379 {{/movie}} 0380 ``` 0381 0382 ## Perl 0383 0384 ```perl 0385 my $var = shift; 0386 0387 $var =~ s/bla/foo/igs; 0388 $var =~ s!bla!foo!igs; 0389 $var =~ s#bla#foo#igs; 0390 ``` 0391 0392 ## PHP 0393 0394 ```php 0395 namespace Application\Controller; 0396 0397 use Zend\Mvc\Controller\AbstractActionController; 0398 0399 class IndexController extends AbstractActionController 0400 { 0401 } 0402 ``` 0403 0404 ## Python 0405 0406 ```python 0407 def addXToY(x, y): 0408 total = x + y 0409 print total 0410 ``` 0411 0412 ## QML 0413 0414 ```qml 0415 Text { 0416 id: hello 0417 width: 100 0418 text: "Hello world!" 0419 } 0420 ``` 0421 0422 ## R 0423 0424 ```r 0425 # Declare function “f” with parameters “x”, “y“ 0426 # that returns a linear combination of x and y. 0427 f <- function(x, y) { 0428 z <- 3 * x + 4 * y 0429 return(z) 0430 } 0431 ``` 0432 0433 ## Raku 0434 0435 ```raku 0436 grammar Parser { 0437 rule TOP { I <love> <lang> } 0438 token love { '♥' | love } 0439 token lang { < Raku Perl Rust Go Python Ruby > } 0440 } 0441 0442 say Parser.parse: 'I ♥ Raku'; 0443 0444 say 1 #`««« blah TODO blah 0445 here? »»» 2 ; 0446 say 1 #` ( blah TODO blah 0447 2 ; 0448 rx- regex - 0449 ``` 0450 0451 ## Ruby 0452 0453 ```ruby 0454 require 'Config' 0455 def CGI::escape(string) 0456 string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do 0457 '%' + $1.unpack('H2' * $1.size).join('%').upcase 0458 end.tr(' ', '+') 0459 end 0460 ``` 0461 0462 ## Rust 0463 0464 ```rust 0465 fn main() { 0466 println!("Hello world!"); 0467 } 0468 ``` 0469 0470 ## MySQL 0471 0472 ```mysql 0473 -- comment 0474 CREATE TABLE stuff COLUMNS(col1 INT, col2 Varchar); 0475 SELECT * FROM stuff WHERE id = 'string'; 0476 select * from stuff where id < 0.42; 0477 Select col1, col2 From stuff Where stuff.col1 IS NOT NuLL; 0478 ``` 0479 0480 ## Nim 0481 0482 ```nim 0483 proc main() = 0484 echo "Hello world!" 0485 ``` 0486 0487 ## TypeScript 0488 0489 ```ts 0490 class Student { 0491 fullName: string; 0492 constructor(public firstName: string, public middleInitial: string, public lastName: string) { 0493 this.fullName = firstName + " " + middleInitial + " " + lastName; 0494 } 0495 } 0496 ``` 0497 0498 ## XML 0499 0500 ```xml 0501 <tag attribute="3"> 0502 <nested/> 0503 </tag> 0504 ``` 0505 0506 ## reStructuredText 0507 0508 ```rst 0509 Section Header 0510 ============== 0511 0512 .. image:: /path/to/image.jpg 0513 0514 - A bullet list item 0515 ``` 0516 0517 ## Doxygen 0518 0519 ```doxygen 0520 a normal member taking two arguments and returning an integer value. 0521 @param a an integer argument. 0522 @param s a constant character pointer. 0523 @see Javadoc_Test() 0524 @see publicVar() 0525 @return The test results 0526 ``` 0527 0528 ## No language specified 0529 0530 ``` 0531 No language is specified, but it should be still rendered as code block. 0532 ``` 0533 0534 # Fenced code blocks with more than 3 backticks or tildes 0535 0536 ~~~ 0537 Fenced code block with 3 tildes. 0538 ~~~ 0539 0540 ````````` 0541 Some implementations of Markdown/MultiMarkdown support more than 3 backticks or tildes. 0542 ``` 0543 The block ends with the same amount of backticks. 0544 ````````` 0545 0546 ~~~~~~~~~~~~ 0547 Fenced code block with more tildes. 0548 ~~~~~~~~~~~~ 0549 0550 ## With languages 0551 0552 ```````html 0553 <html> 0554 <body> 0555 <p class="main">Hello world!</p> 0556 </body> 0557 </html> 0558 ``` <!-- <= doesn't end here --> 0559 ``````` 0560 0561 ~~~bash 0562 for f in *; do 0563 echo "$f" 0564 done 0565 ~~~ 0566 0567 ~~~~~~~~~python 0568 def addXToY(x, y): 0569 total = x + y 0570 print total 0571 ~~~ # <= doesn't end here 0572 ~~~~~~~~~ 0573 0574 # Italic and bold text 0575 0576 **b** *i* __b__ _i_ 0577 ***ib*** ___ib___ 0578 **_ib_** __*ib*__ 0579 0580 * _italic_ **bold** ***ib*** ~~strikeout~~ 0581 0582 > _italic_ **bold** ***ib*** ~~strikeout~~ 0583 0584 ## Bold 0585 **bold*___text** normal 0586 __bold_***text__ normal 0587 0588 ## Italic 0589 *italic _ text* normal 0590 _italic * text_ normal 0591 0592 ## Italic-Bold 0593 ***italic-bold ** italic-bold*** normal 0594 ***bold-italic text **bold-italic text*** normal 0595 ***bold*italic*** normal 0596 **_bold-italic text_** normal 0597 0598 <!-- A non-space character is required after or before * or _ --> 0599 _ normal text_ * normal text * 0600 *italic text*normal text* 0601 *italic text *italic text* 0602 **bold text**normal text** 0603 **bold text **bold text** 0604 0605 <!-- A delimiter is required after or before _ --> 0606 aaa**bold text**aaaaa 0607 aaa__normal text__aaaaa 0608 пристаням_стремятся_ 0609 0610 <!-- Escapes within bold or italic text --> 0611 \*normal text* 0612 _normal text\_ 0613 **italic text\** 0614 ***only bold\*** 0615 **bold\** bold** 0616 0617 ## Highlight 0618 0619 ==very important words== normal 0620 ==very=important=words== normal 0621 0622 <!-- Folding regions for nested headers should also be closed when the parent header is closed --> 0623 # 1 0624 ## 2 0625 ### 3 0626 #### 4 0627 ##### 5 0628 ###### 6 0629 # 11; 1-6 should close here 0630 ## 22 0631 ### 33 0632 ## 222; 22 and 33 should close here