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