├── CNAME ├── spec.html ├── js ├── index.html ├── LICENSE └── commonmark.js ├── index.html └── dingus.html /CNAME: -------------------------------------------------------------------------------- 1 | spec.commonmark.org 2 | -------------------------------------------------------------------------------- /spec.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CommonMark dingus 5 | 6 | 7 | 8 |

The most recent version of the CommonMark spec can be found at http://spec.commonmark.org/.

10 | 11 | 12 | -------------------------------------------------------------------------------- /js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CommonMark dingus 5 | 7 | 8 | 9 |

The most recent version of the CommonMark dingus can be found 10 | at http://spec.commonmark.org/dingus.html.

12 | 13 | 14 | -------------------------------------------------------------------------------- /js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, John MacFarlane 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of John MacFarlane nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CommonMark Spec 6 | 74 | 75 | 89 | 90 | 91 |

CommonMark Spec

92 |
93 | 94 |
95 |
96 | 97 |
98 |
99 |

Latest version (0.7) (2014-10-28)

100 |

discussion forum | interactive dingus | repository

101 |

Older versions:

102 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /dingus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commonmark.js demo 6 | 7 | 8 | 9 | 10 | 94 | 114 | 115 | 116 |
117 |
118 |
119 |

commonmark.js dingus

120 |
121 |
122 |
123 |
124 |

clear 

126 | 127 |
    128 |
    Parsed in 129 | ms. Rendered in ms.
    130 |
    131 |
    132 | 137 |
    138 |
    139 |
    140 |
    141 |
    142 |
    143 |
    144 |
    145 |
    146 |
    147 |
    148 |
    149 | 150 | 151 | -------------------------------------------------------------------------------- /js/commonmark.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.commonmark=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o]" + "|" + 41 | "/" + BLOCKTAGNAME + "[\\s>]" + "|" + "[?!])"; 42 | var reHtmlBlockOpen = new RegExp('^' + HTMLBLOCKOPEN, 'i'); 43 | 44 | var reHrule = /^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/; 45 | 46 | 47 | // DOC PARSER 48 | 49 | // These are methods of a DocParser object, defined below. 50 | 51 | var makeBlock = function(tag, start_line, start_column) { 52 | return { t: tag, 53 | open: true, 54 | last_line_blank: false, 55 | start_line: start_line, 56 | start_column: start_column, 57 | end_line: start_line, 58 | children: [], 59 | parent: null, 60 | // string_content is formed by concatenating strings, in finalize: 61 | string_content: "", 62 | strings: [], 63 | inline_content: [] 64 | }; 65 | }; 66 | 67 | // Returns true if parent block can contain child block. 68 | var canContain = function(parent_type, child_type) { 69 | return ( parent_type == 'Document' || 70 | parent_type == 'BlockQuote' || 71 | parent_type == 'ListItem' || 72 | (parent_type == 'List' && child_type == 'ListItem') ); 73 | }; 74 | 75 | // Returns true if block type can accept lines of text. 76 | var acceptsLines = function(block_type) { 77 | return ( block_type == 'Paragraph' || 78 | block_type == 'IndentedCode' || 79 | block_type == 'FencedCode' ); 80 | }; 81 | 82 | // Returns true if block ends with a blank line, descending if needed 83 | // into lists and sublists. 84 | var endsWithBlankLine = function(block) { 85 | if (block.last_line_blank) { 86 | return true; 87 | } 88 | if ((block.t == 'List' || block.t == 'ListItem') && block.children.length > 0) { 89 | return endsWithBlankLine(block.children[block.children.length - 1]); 90 | } else { 91 | return false; 92 | } 93 | }; 94 | 95 | // Break out of all containing lists, resetting the tip of the 96 | // document to the parent of the highest list, and finalizing 97 | // all the lists. (This is used to implement the "two blank lines 98 | // break of of all lists" feature.) 99 | var breakOutOfLists = function(block, line_number) { 100 | var b = block; 101 | var last_list = null; 102 | do { 103 | if (b.t === 'List') { 104 | last_list = b; 105 | } 106 | b = b.parent; 107 | } while (b); 108 | 109 | if (last_list) { 110 | while (block != last_list) { 111 | this.finalize(block, line_number); 112 | block = block.parent; 113 | } 114 | this.finalize(last_list, line_number); 115 | this.tip = last_list.parent; 116 | } 117 | }; 118 | 119 | // Add a line to the block at the tip. We assume the tip 120 | // can accept lines -- that check should be done before calling this. 121 | var addLine = function(ln, offset) { 122 | var s = ln.slice(offset); 123 | if (!(this.tip.open)) { 124 | throw({ msg: "Attempted to add line (" + ln + ") to closed container." }); 125 | } 126 | this.tip.strings.push(s); 127 | }; 128 | 129 | // Add block of type tag as a child of the tip. If the tip can't 130 | // accept children, close and finalize it and try its parent, 131 | // and so on til we find a block that can accept children. 132 | var addChild = function(tag, line_number, offset) { 133 | while (!canContain(this.tip.t, tag)) { 134 | this.finalize(this.tip, line_number); 135 | } 136 | 137 | var column_number = offset + 1; // offset 0 = column 1 138 | var newBlock = makeBlock(tag, line_number, column_number); 139 | this.tip.children.push(newBlock); 140 | newBlock.parent = this.tip; 141 | this.tip = newBlock; 142 | return newBlock; 143 | }; 144 | 145 | // Parse a list marker and return data on the marker (type, 146 | // start, delimiter, bullet character, padding) or null. 147 | var parseListMarker = function(ln, offset) { 148 | var rest = ln.slice(offset); 149 | var match; 150 | var spaces_after_marker; 151 | var data = {}; 152 | if (rest.match(reHrule)) { 153 | return null; 154 | } 155 | if ((match = rest.match(/^[*+-]( +|$)/))) { 156 | spaces_after_marker = match[1].length; 157 | data.type = 'Bullet'; 158 | data.bullet_char = match[0][0]; 159 | 160 | } else if ((match = rest.match(/^(\d+)([.)])( +|$)/))) { 161 | spaces_after_marker = match[3].length; 162 | data.type = 'Ordered'; 163 | data.start = parseInt(match[1]); 164 | data.delimiter = match[2]; 165 | } else { 166 | return null; 167 | } 168 | var blank_item = match[0].length === rest.length; 169 | if (spaces_after_marker >= 5 || 170 | spaces_after_marker < 1 || 171 | blank_item) { 172 | data.padding = match[0].length - spaces_after_marker + 1; 173 | } else { 174 | data.padding = match[0].length; 175 | } 176 | return data; 177 | }; 178 | 179 | // Returns true if the two list items are of the same type, 180 | // with the same delimiter and bullet character. This is used 181 | // in agglomerating list items into lists. 182 | var listsMatch = function(list_data, item_data) { 183 | return (list_data.type === item_data.type && 184 | list_data.delimiter === item_data.delimiter && 185 | list_data.bullet_char === item_data.bullet_char); 186 | }; 187 | 188 | // Analyze a line of text and update the document appropriately. 189 | // We parse markdown text by calling this on each line of input, 190 | // then finalizing the document. 191 | var incorporateLine = function(ln, line_number) { 192 | 193 | var all_matched = true; 194 | var last_child; 195 | var first_nonspace; 196 | var offset = 0; 197 | var match; 198 | var data; 199 | var blank; 200 | var indent; 201 | var last_matched_container; 202 | var i; 203 | var CODE_INDENT = 4; 204 | 205 | var container = this.doc; 206 | var oldtip = this.tip; 207 | 208 | // Convert tabs to spaces: 209 | ln = detabLine(ln); 210 | 211 | // For each containing block, try to parse the associated line start. 212 | // Bail out on failure: container will point to the last matching block. 213 | // Set all_matched to false if not all containers match. 214 | while (container.children.length > 0) { 215 | last_child = container.children[container.children.length - 1]; 216 | if (!last_child.open) { 217 | break; 218 | } 219 | container = last_child; 220 | 221 | match = matchAt(/[^ ]/, ln, offset); 222 | if (match === null) { 223 | first_nonspace = ln.length; 224 | blank = true; 225 | } else { 226 | first_nonspace = match; 227 | blank = false; 228 | } 229 | indent = first_nonspace - offset; 230 | 231 | switch (container.t) { 232 | case 'BlockQuote': 233 | if (indent <= 3 && ln.charCodeAt(first_nonspace) === C_GREATERTHAN) { 234 | offset = first_nonspace + 1; 235 | if (ln.charCodeAt(offset) === C_SPACE) { 236 | offset++; 237 | } 238 | } else { 239 | all_matched = false; 240 | } 241 | break; 242 | 243 | case 'ListItem': 244 | if (indent >= container.list_data.marker_offset + 245 | container.list_data.padding) { 246 | offset += container.list_data.marker_offset + 247 | container.list_data.padding; 248 | } else if (blank) { 249 | offset = first_nonspace; 250 | } else { 251 | all_matched = false; 252 | } 253 | break; 254 | 255 | case 'IndentedCode': 256 | if (indent >= CODE_INDENT) { 257 | offset += CODE_INDENT; 258 | } else if (blank) { 259 | offset = first_nonspace; 260 | } else { 261 | all_matched = false; 262 | } 263 | break; 264 | 265 | case 'ATXHeader': 266 | case 'SetextHeader': 267 | case 'HorizontalRule': 268 | // a header can never container > 1 line, so fail to match: 269 | all_matched = false; 270 | break; 271 | 272 | case 'FencedCode': 273 | // skip optional spaces of fence offset 274 | i = container.fence_offset; 275 | while (i > 0 && ln.charCodeAt(offset) === C_SPACE) { 276 | offset++; 277 | i--; 278 | } 279 | break; 280 | 281 | case 'HtmlBlock': 282 | if (blank) { 283 | all_matched = false; 284 | } 285 | break; 286 | 287 | case 'Paragraph': 288 | if (blank) { 289 | container.last_line_blank = true; 290 | all_matched = false; 291 | } 292 | break; 293 | 294 | default: 295 | } 296 | 297 | if (!all_matched) { 298 | container = container.parent; // back up to last matching block 299 | break; 300 | } 301 | } 302 | 303 | last_matched_container = container; 304 | 305 | // This function is used to finalize and close any unmatched 306 | // blocks. We aren't ready to do this now, because we might 307 | // have a lazy paragraph continuation, in which case we don't 308 | // want to close unmatched blocks. So we store this closure for 309 | // use later, when we have more information. 310 | var closeUnmatchedBlocks = function(mythis) { 311 | // finalize any blocks not matched 312 | while (!already_done && oldtip != last_matched_container) { 313 | mythis.finalize(oldtip, line_number); 314 | oldtip = oldtip.parent; 315 | } 316 | var already_done = true; 317 | }; 318 | 319 | // Check to see if we've hit 2nd blank line; if so break out of list: 320 | if (blank && container.last_line_blank) { 321 | this.breakOutOfLists(container, line_number); 322 | } 323 | 324 | // Unless last matched container is a code block, try new container starts, 325 | // adding children to the last matched container: 326 | while (container.t != 'FencedCode' && 327 | container.t != 'IndentedCode' && 328 | container.t != 'HtmlBlock' && 329 | // this is a little performance optimization: 330 | matchAt(/^[ #`~*+_=<>0-9-]/,ln,offset) !== null) { 331 | 332 | match = matchAt(/[^ ]/, ln, offset); 333 | if (match === null) { 334 | first_nonspace = ln.length; 335 | blank = true; 336 | } else { 337 | first_nonspace = match; 338 | blank = false; 339 | } 340 | indent = first_nonspace - offset; 341 | 342 | if (indent >= CODE_INDENT) { 343 | // indented code 344 | if (this.tip.t != 'Paragraph' && !blank) { 345 | offset += CODE_INDENT; 346 | closeUnmatchedBlocks(this); 347 | container = this.addChild('IndentedCode', line_number, offset); 348 | } else { // indent > 4 in a lazy paragraph continuation 349 | break; 350 | } 351 | 352 | } else if (ln.charCodeAt(first_nonspace) === C_GREATERTHAN) { 353 | // blockquote 354 | offset = first_nonspace + 1; 355 | // optional following space 356 | if (ln.charCodeAt(offset) === C_SPACE) { 357 | offset++; 358 | } 359 | closeUnmatchedBlocks(this); 360 | container = this.addChild('BlockQuote', line_number, offset); 361 | 362 | } else if ((match = ln.slice(first_nonspace).match(/^#{1,6}(?: +|$)/))) { 363 | // ATX header 364 | offset = first_nonspace + match[0].length; 365 | closeUnmatchedBlocks(this); 366 | container = this.addChild('ATXHeader', line_number, first_nonspace); 367 | container.level = match[0].trim().length; // number of #s 368 | // remove trailing ###s: 369 | container.strings = 370 | [ln.slice(offset).replace(/^ *#+ *$/, '').replace(/ +#+ *$/,'')]; 371 | break; 372 | 373 | } else if ((match = ln.slice(first_nonspace).match(/^`{3,}(?!.*`)|^~{3,}(?!.*~)/))) { 374 | // fenced code block 375 | var fence_length = match[0].length; 376 | closeUnmatchedBlocks(this); 377 | container = this.addChild('FencedCode', line_number, first_nonspace); 378 | container.fence_length = fence_length; 379 | container.fence_char = match[0][0]; 380 | container.fence_offset = first_nonspace - offset; 381 | offset = first_nonspace + fence_length; 382 | break; 383 | 384 | } else if (matchAt(reHtmlBlockOpen, ln, first_nonspace) !== null) { 385 | // html block 386 | closeUnmatchedBlocks(this); 387 | container = this.addChild('HtmlBlock', line_number, first_nonspace); 388 | // note, we don't adjust offset because the tag is part of the text 389 | break; 390 | 391 | } else if (container.t == 'Paragraph' && 392 | container.strings.length === 1 && 393 | ((match = ln.slice(first_nonspace).match(/^(?:=+|-+) *$/)))) { 394 | // setext header line 395 | closeUnmatchedBlocks(this); 396 | container.t = 'SetextHeader'; // convert Paragraph to SetextHeader 397 | container.level = match[0][0] === '=' ? 1 : 2; 398 | offset = ln.length; 399 | 400 | } else if (matchAt(reHrule, ln, first_nonspace) !== null) { 401 | // hrule 402 | closeUnmatchedBlocks(this); 403 | container = this.addChild('HorizontalRule', line_number, first_nonspace); 404 | offset = ln.length - 1; 405 | break; 406 | 407 | } else if ((data = parseListMarker(ln, first_nonspace))) { 408 | // list item 409 | closeUnmatchedBlocks(this); 410 | data.marker_offset = indent; 411 | offset = first_nonspace + data.padding; 412 | 413 | // add the list if needed 414 | if (container.t !== 'List' || 415 | !(listsMatch(container.list_data, data))) { 416 | container = this.addChild('List', line_number, first_nonspace); 417 | container.list_data = data; 418 | } 419 | 420 | // add the list item 421 | container = this.addChild('ListItem', line_number, first_nonspace); 422 | container.list_data = data; 423 | 424 | } else { 425 | break; 426 | 427 | } 428 | 429 | if (acceptsLines(container.t)) { 430 | // if it's a line container, it can't contain other containers 431 | break; 432 | } 433 | } 434 | 435 | // What remains at the offset is a text line. Add the text to the 436 | // appropriate container. 437 | 438 | match = matchAt(/[^ ]/, ln, offset); 439 | if (match === null) { 440 | first_nonspace = ln.length; 441 | blank = true; 442 | } else { 443 | first_nonspace = match; 444 | blank = false; 445 | } 446 | indent = first_nonspace - offset; 447 | 448 | // First check for a lazy paragraph continuation: 449 | if (this.tip !== last_matched_container && 450 | !blank && 451 | this.tip.t == 'Paragraph' && 452 | this.tip.strings.length > 0) { 453 | // lazy paragraph continuation 454 | 455 | this.last_line_blank = false; 456 | this.addLine(ln, offset); 457 | 458 | } else { // not a lazy continuation 459 | 460 | // finalize any blocks not matched 461 | closeUnmatchedBlocks(this); 462 | 463 | // Block quote lines are never blank as they start with > 464 | // and we don't count blanks in fenced code for purposes of tight/loose 465 | // lists or breaking out of lists. We also don't set last_line_blank 466 | // on an empty list item. 467 | container.last_line_blank = blank && 468 | !(container.t == 'BlockQuote' || 469 | container.t == 'FencedCode' || 470 | (container.t == 'ListItem' && 471 | container.children.length === 0 && 472 | container.start_line == line_number)); 473 | 474 | var cont = container; 475 | while (cont.parent) { 476 | cont.parent.last_line_blank = false; 477 | cont = cont.parent; 478 | } 479 | 480 | switch (container.t) { 481 | case 'IndentedCode': 482 | case 'HtmlBlock': 483 | this.addLine(ln, offset); 484 | break; 485 | 486 | case 'FencedCode': 487 | // check for closing code fence: 488 | match = (indent <= 3 && 489 | ln.charAt(first_nonspace) == container.fence_char && 490 | ln.slice(first_nonspace).match(/^(?:`{3,}|~{3,})(?= *$)/)); 491 | if (match && match[0].length >= container.fence_length) { 492 | // don't add closing fence to container; instead, close it: 493 | this.finalize(container, line_number); 494 | } else { 495 | this.addLine(ln, offset); 496 | } 497 | break; 498 | 499 | case 'ATXHeader': 500 | case 'SetextHeader': 501 | case 'HorizontalRule': 502 | // nothing to do; we already added the contents. 503 | break; 504 | 505 | default: 506 | if (acceptsLines(container.t)) { 507 | this.addLine(ln, first_nonspace); 508 | } else if (blank) { 509 | // do nothing 510 | } else if (container.t != 'HorizontalRule' && 511 | container.t != 'SetextHeader') { 512 | // create paragraph container for line 513 | container = this.addChild('Paragraph', line_number, first_nonspace); 514 | this.addLine(ln, first_nonspace); 515 | } else { 516 | console.log("Line " + line_number.toString() + 517 | " with container type " + container.t + 518 | " did not match any condition."); 519 | 520 | } 521 | } 522 | } 523 | }; 524 | 525 | // Finalize a block. Close it and do any necessary postprocessing, 526 | // e.g. creating string_content from strings, setting the 'tight' 527 | // or 'loose' status of a list, and parsing the beginnings 528 | // of paragraphs for reference definitions. Reset the tip to the 529 | // parent of the closed block. 530 | var finalize = function(block, line_number) { 531 | var pos; 532 | // don't do anything if the block is already closed 533 | if (!block.open) { 534 | return 0; 535 | } 536 | block.open = false; 537 | if (line_number > block.start_line) { 538 | block.end_line = line_number - 1; 539 | } else { 540 | block.end_line = line_number; 541 | } 542 | 543 | switch (block.t) { 544 | case 'Paragraph': 545 | block.string_content = block.strings.join('\n').replace(/^ */m,''); 546 | // delete block.strings; 547 | 548 | // try parsing the beginning as link reference definitions: 549 | while (block.string_content.charCodeAt(0) === C_OPEN_BRACKET && 550 | (pos = this.inlineParser.parseReference(block.string_content, 551 | this.refmap))) { 552 | block.string_content = block.string_content.slice(pos); 553 | if (isBlank(block.string_content)) { 554 | block.t = 'ReferenceDef'; 555 | break; 556 | } 557 | } 558 | break; 559 | 560 | case 'ATXHeader': 561 | case 'SetextHeader': 562 | case 'HtmlBlock': 563 | block.string_content = block.strings.join('\n'); 564 | break; 565 | 566 | case 'IndentedCode': 567 | block.string_content = block.strings.join('\n').replace(/(\n *)*$/,'\n'); 568 | break; 569 | 570 | case 'FencedCode': 571 | // first line becomes info string 572 | block.info = unescapeString(block.strings[0].trim()); 573 | if (block.strings.length == 1) { 574 | block.string_content = ''; 575 | } else { 576 | block.string_content = block.strings.slice(1).join('\n') + '\n'; 577 | } 578 | break; 579 | 580 | case 'List': 581 | block.tight = true; // tight by default 582 | 583 | var numitems = block.children.length; 584 | var i = 0; 585 | while (i < numitems) { 586 | var item = block.children[i]; 587 | // check for non-final list item ending with blank line: 588 | var last_item = i == numitems - 1; 589 | if (endsWithBlankLine(item) && !last_item) { 590 | block.tight = false; 591 | break; 592 | } 593 | // recurse into children of list item, to see if there are 594 | // spaces between any of them: 595 | var numsubitems = item.children.length; 596 | var j = 0; 597 | while (j < numsubitems) { 598 | var subitem = item.children[j]; 599 | var last_subitem = j == numsubitems - 1; 600 | if (endsWithBlankLine(subitem) && !(last_item && last_subitem)) { 601 | block.tight = false; 602 | break; 603 | } 604 | j++; 605 | } 606 | i++; 607 | } 608 | break; 609 | 610 | default: 611 | break; 612 | } 613 | 614 | this.tip = block.parent || this.top; 615 | }; 616 | 617 | // Walk through a block & children recursively, parsing string content 618 | // into inline content where appropriate. Returns new object. 619 | var processInlines = function(block) { 620 | var newblock = {}; 621 | newblock.t = block.t; 622 | newblock.start_line = block.start_line; 623 | newblock.start_column = block.start_column; 624 | newblock.end_line = block.end_line; 625 | 626 | switch(block.t) { 627 | case 'Paragraph': 628 | newblock.inline_content = 629 | this.inlineParser.parse(block.string_content.trim(), this.refmap); 630 | break; 631 | case 'SetextHeader': 632 | case 'ATXHeader': 633 | newblock.inline_content = 634 | this.inlineParser.parse(block.string_content.trim(), this.refmap); 635 | newblock.level = block.level; 636 | break; 637 | case 'List': 638 | newblock.list_data = block.list_data; 639 | newblock.tight = block.tight; 640 | break; 641 | case 'FencedCode': 642 | newblock.string_content = block.string_content; 643 | newblock.info = block.info; 644 | break; 645 | case 'IndentedCode': 646 | case 'HtmlBlock': 647 | newblock.string_content = block.string_content; 648 | break; 649 | default: 650 | break; 651 | } 652 | 653 | if (block.children) { 654 | var newchildren = []; 655 | for (var i = 0; i < block.children.length; i++) { 656 | newchildren.push(this.processInlines(block.children[i])); 657 | } 658 | newblock.children = newchildren; 659 | } 660 | return newblock; 661 | }; 662 | 663 | // The main parsing function. Returns a parsed document AST. 664 | var parse = function(input) { 665 | this.doc = makeBlock('Document', 1, 1); 666 | this.tip = this.doc; 667 | this.refmap = {}; 668 | var lines = input.replace(/\n$/,'').split(/\r\n|\n|\r/); 669 | var len = lines.length; 670 | for (var i = 0; i < len; i++) { 671 | this.incorporateLine(lines[i], i+1); 672 | } 673 | while (this.tip) { 674 | this.finalize(this.tip, len - 1); 675 | } 676 | return this.processInlines(this.doc); 677 | }; 678 | 679 | 680 | // The DocParser object. 681 | function DocParser(){ 682 | return { 683 | doc: makeBlock('Document', 1, 1), 684 | tip: this.doc, 685 | refmap: {}, 686 | inlineParser: new InlineParser(), 687 | breakOutOfLists: breakOutOfLists, 688 | addLine: addLine, 689 | addChild: addChild, 690 | incorporateLine: incorporateLine, 691 | finalize: finalize, 692 | processInlines: processInlines, 693 | parse: parse 694 | }; 695 | } 696 | 697 | module.exports = DocParser; 698 | 699 | },{"./inlines":6}],2:[function(require,module,exports){ 700 | // derived from https://github.com/mathiasbynens/String.fromCodePoint 701 | /*! http://mths.be/fromcodepoint v0.2.1 by @mathias */ 702 | if (String.fromCodePoint) { 703 | 704 | module.exports = String.fromCodePoint; 705 | 706 | } else { 707 | 708 | var stringFromCharCode = String.fromCharCode; 709 | var floor = Math.floor; 710 | var fromCodePoint = function(_) { 711 | var MAX_SIZE = 0x4000; 712 | var codeUnits = []; 713 | var highSurrogate; 714 | var lowSurrogate; 715 | var index = -1; 716 | var length = arguments.length; 717 | if (!length) { 718 | return ''; 719 | } 720 | var result = ''; 721 | while (++index < length) { 722 | var codePoint = Number(arguments[index]); 723 | if ( 724 | !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` 725 | codePoint < 0 || // not a valid Unicode code point 726 | codePoint > 0x10FFFF || // not a valid Unicode code point 727 | floor(codePoint) != codePoint // not an integer 728 | ) { 729 | return String.fromCharCode(0xFFFD); 730 | } 731 | if (codePoint <= 0xFFFF) { // BMP code point 732 | codeUnits.push(codePoint); 733 | } else { // Astral code point; split in surrogate halves 734 | // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 735 | codePoint -= 0x10000; 736 | highSurrogate = (codePoint >> 10) + 0xD800; 737 | lowSurrogate = (codePoint % 0x400) + 0xDC00; 738 | codeUnits.push(highSurrogate, lowSurrogate); 739 | } 740 | if (index + 1 == length || codeUnits.length > MAX_SIZE) { 741 | result += stringFromCharCode.apply(null, codeUnits); 742 | codeUnits.length = 0; 743 | } 744 | } 745 | return result; 746 | }; 747 | module.exports = fromCodePoint; 748 | } 749 | 750 | },{}],3:[function(require,module,exports){ 751 | // Helper function to produce content in a pair of HTML tags. 752 | var inTags = function(tag, attribs, contents, selfclosing) { 753 | var result = '<' + tag; 754 | if (attribs) { 755 | var i = 0; 756 | var attrib; 757 | while ((attrib = attribs[i]) !== undefined) { 758 | result = result.concat(' ', attrib[0], '="', attrib[1], '"'); 759 | i++; 760 | } 761 | } 762 | if (contents) { 763 | result = result.concat('>', contents, ''); 764 | } else if (selfclosing) { 765 | result = result + ' />'; 766 | } else { 767 | result = result.concat('>'); 768 | } 769 | return result; 770 | }; 771 | 772 | // Render an inline element as HTML. 773 | var renderInline = function(inline) { 774 | var attrs; 775 | switch (inline.t) { 776 | case 'Str': 777 | return this.escape(inline.c); 778 | case 'Softbreak': 779 | return this.softbreak; 780 | case 'Hardbreak': 781 | return inTags('br',[],"",true) + '\n'; 782 | case 'Emph': 783 | return inTags('em', [], this.renderInlines(inline.c)); 784 | case 'Strong': 785 | return inTags('strong', [], this.renderInlines(inline.c)); 786 | case 'Html': 787 | return inline.c; 788 | case 'Link': 789 | attrs = [['href', this.escape(inline.destination, true)]]; 790 | if (inline.title) { 791 | attrs.push(['title', this.escape(inline.title, true)]); 792 | } 793 | return inTags('a', attrs, this.renderInlines(inline.label)); 794 | case 'Image': 795 | attrs = [['src', this.escape(inline.destination, true)], 796 | ['alt', this.escape(this.renderInlines(inline.label))]]; 797 | if (inline.title) { 798 | attrs.push(['title', this.escape(inline.title, true)]); 799 | } 800 | return inTags('img', attrs, "", true); 801 | case 'Code': 802 | return inTags('code', [], this.escape(inline.c)); 803 | default: 804 | console.log("Unknown inline type " + inline.t); 805 | return ""; 806 | } 807 | }; 808 | 809 | // Render a list of inlines. 810 | var renderInlines = function(inlines) { 811 | var result = ''; 812 | for (var i=0; i < inlines.length; i++) { 813 | result = result + this.renderInline(inlines[i]); 814 | } 815 | return result; 816 | }; 817 | 818 | // Render a single block element. 819 | var renderBlock = function(block, in_tight_list) { 820 | var tag; 821 | var attr; 822 | var info_words; 823 | switch (block.t) { 824 | case 'Document': 825 | var whole_doc = this.renderBlocks(block.children); 826 | return (whole_doc === '' ? '' : whole_doc + '\n'); 827 | case 'Paragraph': 828 | if (in_tight_list) { 829 | return this.renderInlines(block.inline_content); 830 | } else { 831 | return inTags('p', [], this.renderInlines(block.inline_content)); 832 | } 833 | break; 834 | case 'BlockQuote': 835 | var filling = this.renderBlocks(block.children); 836 | return inTags('blockquote', [], filling === '' ? this.innersep : 837 | this.innersep + filling + this.innersep); 838 | case 'ListItem': 839 | return inTags('li', [], this.renderBlocks(block.children, in_tight_list).trim()); 840 | case 'List': 841 | tag = block.list_data.type == 'Bullet' ? 'ul' : 'ol'; 842 | attr = (!block.list_data.start || block.list_data.start == 1) ? 843 | [] : [['start', block.list_data.start.toString()]]; 844 | return inTags(tag, attr, this.innersep + 845 | this.renderBlocks(block.children, block.tight) + 846 | this.innersep); 847 | case 'ATXHeader': 848 | case 'SetextHeader': 849 | tag = 'h' + block.level; 850 | return inTags(tag, [], this.renderInlines(block.inline_content)); 851 | case 'IndentedCode': 852 | return inTags('pre', [], 853 | inTags('code', [], this.escape(block.string_content))); 854 | case 'FencedCode': 855 | info_words = block.info.split(/ +/); 856 | attr = info_words.length === 0 || info_words[0].length === 0 ? 857 | [] : [['class','language-' + 858 | this.escape(info_words[0],true)]]; 859 | return inTags('pre', [], 860 | inTags('code', attr, this.escape(block.string_content))); 861 | case 'HtmlBlock': 862 | return block.string_content; 863 | case 'ReferenceDef': 864 | return ""; 865 | case 'HorizontalRule': 866 | return inTags('hr',[],"",true); 867 | default: 868 | console.log("Unknown block type " + block.t); 869 | return ""; 870 | } 871 | }; 872 | 873 | // Render a list of block elements, separated by this.blocksep. 874 | var renderBlocks = function(blocks, in_tight_list) { 875 | var result = []; 876 | for (var i=0; i < blocks.length; i++) { 877 | if (blocks[i].t !== 'ReferenceDef') { 878 | result.push(this.renderBlock(blocks[i], in_tight_list)); 879 | } 880 | } 881 | return result.join(this.blocksep); 882 | }; 883 | 884 | // The HtmlRenderer object. 885 | function HtmlRenderer(){ 886 | return { 887 | // default options: 888 | blocksep: '\n', // space between blocks 889 | innersep: '\n', // space between block container tag and contents 890 | softbreak: '\n', // by default, soft breaks are rendered as newlines in HTML 891 | // set to "
    " to make them hard breaks 892 | // set to " " if you want to ignore line wrapping in source 893 | escape: function(s, preserve_entities) { 894 | if (preserve_entities) { 895 | return s.replace(/[&](?![#](x[a-f0-9]{1,8}|[0-9]{1,8});|[a-z][a-z0-9]{1,31};)/gi,'&') 896 | .replace(/[<]/g,'<') 897 | .replace(/[>]/g,'>') 898 | .replace(/["]/g,'"'); 899 | } else { 900 | return s.replace(/[&]/g,'&') 901 | .replace(/[<]/g,'<') 902 | .replace(/[>]/g,'>') 903 | .replace(/["]/g,'"'); 904 | } 905 | }, 906 | renderInline: renderInline, 907 | renderInlines: renderInlines, 908 | renderBlock: renderBlock, 909 | renderBlocks: renderBlocks, 910 | render: renderBlock 911 | }; 912 | } 913 | 914 | module.exports = HtmlRenderer; 915 | 916 | },{}],4:[function(require,module,exports){ 917 | var fromCodePoint = require('./from-code-point'); 918 | 919 | var entities = { AAacute: 'Á', 920 | aacute: 'á', 921 | Abreve: 'Ă', 922 | abreve: 'ă', 923 | ac: '∾', 924 | acd: '∿', 925 | acE: '∾', 926 | Acirc: 'Â', 927 | acirc: 'â', 928 | acute: '´', 929 | Acy: 'А', 930 | acy: 'а', 931 | AElig: 'Æ', 932 | aelig: 'æ', 933 | af: '⁡', 934 | Afr: '𝔄', 935 | afr: '𝔞', 936 | Agrave: 'À', 937 | agrave: 'à', 938 | alefsym: 'ℵ', 939 | aleph: 'ℵ', 940 | Alpha: 'Α', 941 | alpha: 'α', 942 | Amacr: 'Ā', 943 | amacr: 'ā', 944 | amalg: '⨿', 945 | amp: '&', 946 | AMP: '&', 947 | andand: '⩕', 948 | And: '⩓', 949 | and: '∧', 950 | andd: '⩜', 951 | andslope: '⩘', 952 | andv: '⩚', 953 | ang: '∠', 954 | ange: '⦤', 955 | angle: '∠', 956 | angmsdaa: '⦨', 957 | angmsdab: '⦩', 958 | angmsdac: '⦪', 959 | angmsdad: '⦫', 960 | angmsdae: '⦬', 961 | angmsdaf: '⦭', 962 | angmsdag: '⦮', 963 | angmsdah: '⦯', 964 | angmsd: '∡', 965 | angrt: '∟', 966 | angrtvb: '⊾', 967 | angrtvbd: '⦝', 968 | angsph: '∢', 969 | angst: 'Å', 970 | angzarr: '⍼', 971 | Aogon: 'Ą', 972 | aogon: 'ą', 973 | Aopf: '𝔸', 974 | aopf: '𝕒', 975 | apacir: '⩯', 976 | ap: '≈', 977 | apE: '⩰', 978 | ape: '≊', 979 | apid: '≋', 980 | apos: '\'', 981 | ApplyFunction: '⁡', 982 | approx: '≈', 983 | approxeq: '≊', 984 | Aring: 'Å', 985 | aring: 'å', 986 | Ascr: '𝒜', 987 | ascr: '𝒶', 988 | Assign: '≔', 989 | ast: '*', 990 | asymp: '≈', 991 | asympeq: '≍', 992 | Atilde: 'Ã', 993 | atilde: 'ã', 994 | Auml: 'Ä', 995 | auml: 'ä', 996 | awconint: '∳', 997 | awint: '⨑', 998 | backcong: '≌', 999 | backepsilon: '϶', 1000 | backprime: '‵', 1001 | backsim: '∽', 1002 | backsimeq: '⋍', 1003 | Backslash: '∖', 1004 | Barv: '⫧', 1005 | barvee: '⊽', 1006 | barwed: '⌅', 1007 | Barwed: '⌆', 1008 | barwedge: '⌅', 1009 | bbrk: '⎵', 1010 | bbrktbrk: '⎶', 1011 | bcong: '≌', 1012 | Bcy: 'Б', 1013 | bcy: 'б', 1014 | bdquo: '„', 1015 | becaus: '∵', 1016 | because: '∵', 1017 | Because: '∵', 1018 | bemptyv: '⦰', 1019 | bepsi: '϶', 1020 | bernou: 'ℬ', 1021 | Bernoullis: 'ℬ', 1022 | Beta: 'Β', 1023 | beta: 'β', 1024 | beth: 'ℶ', 1025 | between: '≬', 1026 | Bfr: '𝔅', 1027 | bfr: '𝔟', 1028 | bigcap: '⋂', 1029 | bigcirc: '◯', 1030 | bigcup: '⋃', 1031 | bigodot: '⨀', 1032 | bigoplus: '⨁', 1033 | bigotimes: '⨂', 1034 | bigsqcup: '⨆', 1035 | bigstar: '★', 1036 | bigtriangledown: '▽', 1037 | bigtriangleup: '△', 1038 | biguplus: '⨄', 1039 | bigvee: '⋁', 1040 | bigwedge: '⋀', 1041 | bkarow: '⤍', 1042 | blacklozenge: '⧫', 1043 | blacksquare: '▪', 1044 | blacktriangle: '▴', 1045 | blacktriangledown: '▾', 1046 | blacktriangleleft: '◂', 1047 | blacktriangleright: '▸', 1048 | blank: '␣', 1049 | blk12: '▒', 1050 | blk14: '░', 1051 | blk34: '▓', 1052 | block: '█', 1053 | bne: '=', 1054 | bnequiv: '≡', 1055 | bNot: '⫭', 1056 | bnot: '⌐', 1057 | Bopf: '𝔹', 1058 | bopf: '𝕓', 1059 | bot: '⊥', 1060 | bottom: '⊥', 1061 | bowtie: '⋈', 1062 | boxbox: '⧉', 1063 | boxdl: '┐', 1064 | boxdL: '╕', 1065 | boxDl: '╖', 1066 | boxDL: '╗', 1067 | boxdr: '┌', 1068 | boxdR: '╒', 1069 | boxDr: '╓', 1070 | boxDR: '╔', 1071 | boxh: '─', 1072 | boxH: '═', 1073 | boxhd: '┬', 1074 | boxHd: '╤', 1075 | boxhD: '╥', 1076 | boxHD: '╦', 1077 | boxhu: '┴', 1078 | boxHu: '╧', 1079 | boxhU: '╨', 1080 | boxHU: '╩', 1081 | boxminus: '⊟', 1082 | boxplus: '⊞', 1083 | boxtimes: '⊠', 1084 | boxul: '┘', 1085 | boxuL: '╛', 1086 | boxUl: '╜', 1087 | boxUL: '╝', 1088 | boxur: '└', 1089 | boxuR: '╘', 1090 | boxUr: '╙', 1091 | boxUR: '╚', 1092 | boxv: '│', 1093 | boxV: '║', 1094 | boxvh: '┼', 1095 | boxvH: '╪', 1096 | boxVh: '╫', 1097 | boxVH: '╬', 1098 | boxvl: '┤', 1099 | boxvL: '╡', 1100 | boxVl: '╢', 1101 | boxVL: '╣', 1102 | boxvr: '├', 1103 | boxvR: '╞', 1104 | boxVr: '╟', 1105 | boxVR: '╠', 1106 | bprime: '‵', 1107 | breve: '˘', 1108 | Breve: '˘', 1109 | brvbar: '¦', 1110 | bscr: '𝒷', 1111 | Bscr: 'ℬ', 1112 | bsemi: '⁏', 1113 | bsim: '∽', 1114 | bsime: '⋍', 1115 | bsolb: '⧅', 1116 | bsol: '\\', 1117 | bsolhsub: '⟈', 1118 | bull: '•', 1119 | bullet: '•', 1120 | bump: '≎', 1121 | bumpE: '⪮', 1122 | bumpe: '≏', 1123 | Bumpeq: '≎', 1124 | bumpeq: '≏', 1125 | Cacute: 'Ć', 1126 | cacute: 'ć', 1127 | capand: '⩄', 1128 | capbrcup: '⩉', 1129 | capcap: '⩋', 1130 | cap: '∩', 1131 | Cap: '⋒', 1132 | capcup: '⩇', 1133 | capdot: '⩀', 1134 | CapitalDifferentialD: 'ⅅ', 1135 | caps: '∩', 1136 | caret: '⁁', 1137 | caron: 'ˇ', 1138 | Cayleys: 'ℭ', 1139 | ccaps: '⩍', 1140 | Ccaron: 'Č', 1141 | ccaron: 'č', 1142 | Ccedil: 'Ç', 1143 | ccedil: 'ç', 1144 | Ccirc: 'Ĉ', 1145 | ccirc: 'ĉ', 1146 | Cconint: '∰', 1147 | ccups: '⩌', 1148 | ccupssm: '⩐', 1149 | Cdot: 'Ċ', 1150 | cdot: 'ċ', 1151 | cedil: '¸', 1152 | Cedilla: '¸', 1153 | cemptyv: '⦲', 1154 | cent: '¢', 1155 | centerdot: '·', 1156 | CenterDot: '·', 1157 | cfr: '𝔠', 1158 | Cfr: 'ℭ', 1159 | CHcy: 'Ч', 1160 | chcy: 'ч', 1161 | check: '✓', 1162 | checkmark: '✓', 1163 | Chi: 'Χ', 1164 | chi: 'χ', 1165 | circ: 'ˆ', 1166 | circeq: '≗', 1167 | circlearrowleft: '↺', 1168 | circlearrowright: '↻', 1169 | circledast: '⊛', 1170 | circledcirc: '⊚', 1171 | circleddash: '⊝', 1172 | CircleDot: '⊙', 1173 | circledR: '®', 1174 | circledS: 'Ⓢ', 1175 | CircleMinus: '⊖', 1176 | CirclePlus: '⊕', 1177 | CircleTimes: '⊗', 1178 | cir: '○', 1179 | cirE: '⧃', 1180 | cire: '≗', 1181 | cirfnint: '⨐', 1182 | cirmid: '⫯', 1183 | cirscir: '⧂', 1184 | ClockwiseContourIntegral: '∲', 1185 | CloseCurlyDoubleQuote: '”', 1186 | CloseCurlyQuote: '’', 1187 | clubs: '♣', 1188 | clubsuit: '♣', 1189 | colon: ':', 1190 | Colon: '∷', 1191 | Colone: '⩴', 1192 | colone: '≔', 1193 | coloneq: '≔', 1194 | comma: ',', 1195 | commat: '@', 1196 | comp: '∁', 1197 | compfn: '∘', 1198 | complement: '∁', 1199 | complexes: 'ℂ', 1200 | cong: '≅', 1201 | congdot: '⩭', 1202 | Congruent: '≡', 1203 | conint: '∮', 1204 | Conint: '∯', 1205 | ContourIntegral: '∮', 1206 | copf: '𝕔', 1207 | Copf: 'ℂ', 1208 | coprod: '∐', 1209 | Coproduct: '∐', 1210 | copy: '©', 1211 | COPY: '©', 1212 | copysr: '℗', 1213 | CounterClockwiseContourIntegral: '∳', 1214 | crarr: '↵', 1215 | cross: '✗', 1216 | Cross: '⨯', 1217 | Cscr: '𝒞', 1218 | cscr: '𝒸', 1219 | csub: '⫏', 1220 | csube: '⫑', 1221 | csup: '⫐', 1222 | csupe: '⫒', 1223 | ctdot: '⋯', 1224 | cudarrl: '⤸', 1225 | cudarrr: '⤵', 1226 | cuepr: '⋞', 1227 | cuesc: '⋟', 1228 | cularr: '↶', 1229 | cularrp: '⤽', 1230 | cupbrcap: '⩈', 1231 | cupcap: '⩆', 1232 | CupCap: '≍', 1233 | cup: '∪', 1234 | Cup: '⋓', 1235 | cupcup: '⩊', 1236 | cupdot: '⊍', 1237 | cupor: '⩅', 1238 | cups: '∪', 1239 | curarr: '↷', 1240 | curarrm: '⤼', 1241 | curlyeqprec: '⋞', 1242 | curlyeqsucc: '⋟', 1243 | curlyvee: '⋎', 1244 | curlywedge: '⋏', 1245 | curren: '¤', 1246 | curvearrowleft: '↶', 1247 | curvearrowright: '↷', 1248 | cuvee: '⋎', 1249 | cuwed: '⋏', 1250 | cwconint: '∲', 1251 | cwint: '∱', 1252 | cylcty: '⌭', 1253 | dagger: '†', 1254 | Dagger: '‡', 1255 | daleth: 'ℸ', 1256 | darr: '↓', 1257 | Darr: '↡', 1258 | dArr: '⇓', 1259 | dash: '‐', 1260 | Dashv: '⫤', 1261 | dashv: '⊣', 1262 | dbkarow: '⤏', 1263 | dblac: '˝', 1264 | Dcaron: 'Ď', 1265 | dcaron: 'ď', 1266 | Dcy: 'Д', 1267 | dcy: 'д', 1268 | ddagger: '‡', 1269 | ddarr: '⇊', 1270 | DD: 'ⅅ', 1271 | dd: 'ⅆ', 1272 | DDotrahd: '⤑', 1273 | ddotseq: '⩷', 1274 | deg: '°', 1275 | Del: '∇', 1276 | Delta: 'Δ', 1277 | delta: 'δ', 1278 | demptyv: '⦱', 1279 | dfisht: '⥿', 1280 | Dfr: '𝔇', 1281 | dfr: '𝔡', 1282 | dHar: '⥥', 1283 | dharl: '⇃', 1284 | dharr: '⇂', 1285 | DiacriticalAcute: '´', 1286 | DiacriticalDot: '˙', 1287 | DiacriticalDoubleAcute: '˝', 1288 | DiacriticalGrave: '`', 1289 | DiacriticalTilde: '˜', 1290 | diam: '⋄', 1291 | diamond: '⋄', 1292 | Diamond: '⋄', 1293 | diamondsuit: '♦', 1294 | diams: '♦', 1295 | die: '¨', 1296 | DifferentialD: 'ⅆ', 1297 | digamma: 'ϝ', 1298 | disin: '⋲', 1299 | div: '÷', 1300 | divide: '÷', 1301 | divideontimes: '⋇', 1302 | divonx: '⋇', 1303 | DJcy: 'Ђ', 1304 | djcy: 'ђ', 1305 | dlcorn: '⌞', 1306 | dlcrop: '⌍', 1307 | dollar: '$', 1308 | Dopf: '𝔻', 1309 | dopf: '𝕕', 1310 | Dot: '¨', 1311 | dot: '˙', 1312 | DotDot: '⃜', 1313 | doteq: '≐', 1314 | doteqdot: '≑', 1315 | DotEqual: '≐', 1316 | dotminus: '∸', 1317 | dotplus: '∔', 1318 | dotsquare: '⊡', 1319 | doublebarwedge: '⌆', 1320 | DoubleContourIntegral: '∯', 1321 | DoubleDot: '¨', 1322 | DoubleDownArrow: '⇓', 1323 | DoubleLeftArrow: '⇐', 1324 | DoubleLeftRightArrow: '⇔', 1325 | DoubleLeftTee: '⫤', 1326 | DoubleLongLeftArrow: '⟸', 1327 | DoubleLongLeftRightArrow: '⟺', 1328 | DoubleLongRightArrow: '⟹', 1329 | DoubleRightArrow: '⇒', 1330 | DoubleRightTee: '⊨', 1331 | DoubleUpArrow: '⇑', 1332 | DoubleUpDownArrow: '⇕', 1333 | DoubleVerticalBar: '∥', 1334 | DownArrowBar: '⤓', 1335 | downarrow: '↓', 1336 | DownArrow: '↓', 1337 | Downarrow: '⇓', 1338 | DownArrowUpArrow: '⇵', 1339 | DownBreve: '̑', 1340 | downdownarrows: '⇊', 1341 | downharpoonleft: '⇃', 1342 | downharpoonright: '⇂', 1343 | DownLeftRightVector: '⥐', 1344 | DownLeftTeeVector: '⥞', 1345 | DownLeftVectorBar: '⥖', 1346 | DownLeftVector: '↽', 1347 | DownRightTeeVector: '⥟', 1348 | DownRightVectorBar: '⥗', 1349 | DownRightVector: '⇁', 1350 | DownTeeArrow: '↧', 1351 | DownTee: '⊤', 1352 | drbkarow: '⤐', 1353 | drcorn: '⌟', 1354 | drcrop: '⌌', 1355 | Dscr: '𝒟', 1356 | dscr: '𝒹', 1357 | DScy: 'Ѕ', 1358 | dscy: 'ѕ', 1359 | dsol: '⧶', 1360 | Dstrok: 'Đ', 1361 | dstrok: 'đ', 1362 | dtdot: '⋱', 1363 | dtri: '▿', 1364 | dtrif: '▾', 1365 | duarr: '⇵', 1366 | duhar: '⥯', 1367 | dwangle: '⦦', 1368 | DZcy: 'Џ', 1369 | dzcy: 'џ', 1370 | dzigrarr: '⟿', 1371 | Eacute: 'É', 1372 | eacute: 'é', 1373 | easter: '⩮', 1374 | Ecaron: 'Ě', 1375 | ecaron: 'ě', 1376 | Ecirc: 'Ê', 1377 | ecirc: 'ê', 1378 | ecir: '≖', 1379 | ecolon: '≕', 1380 | Ecy: 'Э', 1381 | ecy: 'э', 1382 | eDDot: '⩷', 1383 | Edot: 'Ė', 1384 | edot: 'ė', 1385 | eDot: '≑', 1386 | ee: 'ⅇ', 1387 | efDot: '≒', 1388 | Efr: '𝔈', 1389 | efr: '𝔢', 1390 | eg: '⪚', 1391 | Egrave: 'È', 1392 | egrave: 'è', 1393 | egs: '⪖', 1394 | egsdot: '⪘', 1395 | el: '⪙', 1396 | Element: '∈', 1397 | elinters: '⏧', 1398 | ell: 'ℓ', 1399 | els: '⪕', 1400 | elsdot: '⪗', 1401 | Emacr: 'Ē', 1402 | emacr: 'ē', 1403 | empty: '∅', 1404 | emptyset: '∅', 1405 | EmptySmallSquare: '◻', 1406 | emptyv: '∅', 1407 | EmptyVerySmallSquare: '▫', 1408 | emsp13: ' ', 1409 | emsp14: ' ', 1410 | emsp: ' ', 1411 | ENG: 'Ŋ', 1412 | eng: 'ŋ', 1413 | ensp: ' ', 1414 | Eogon: 'Ę', 1415 | eogon: 'ę', 1416 | Eopf: '𝔼', 1417 | eopf: '𝕖', 1418 | epar: '⋕', 1419 | eparsl: '⧣', 1420 | eplus: '⩱', 1421 | epsi: 'ε', 1422 | Epsilon: 'Ε', 1423 | epsilon: 'ε', 1424 | epsiv: 'ϵ', 1425 | eqcirc: '≖', 1426 | eqcolon: '≕', 1427 | eqsim: '≂', 1428 | eqslantgtr: '⪖', 1429 | eqslantless: '⪕', 1430 | Equal: '⩵', 1431 | equals: '=', 1432 | EqualTilde: '≂', 1433 | equest: '≟', 1434 | Equilibrium: '⇌', 1435 | equiv: '≡', 1436 | equivDD: '⩸', 1437 | eqvparsl: '⧥', 1438 | erarr: '⥱', 1439 | erDot: '≓', 1440 | escr: 'ℯ', 1441 | Escr: 'ℰ', 1442 | esdot: '≐', 1443 | Esim: '⩳', 1444 | esim: '≂', 1445 | Eta: 'Η', 1446 | eta: 'η', 1447 | ETH: 'Ð', 1448 | eth: 'ð', 1449 | Euml: 'Ë', 1450 | euml: 'ë', 1451 | euro: '€', 1452 | excl: '!', 1453 | exist: '∃', 1454 | Exists: '∃', 1455 | expectation: 'ℰ', 1456 | exponentiale: 'ⅇ', 1457 | ExponentialE: 'ⅇ', 1458 | fallingdotseq: '≒', 1459 | Fcy: 'Ф', 1460 | fcy: 'ф', 1461 | female: '♀', 1462 | ffilig: 'ffi', 1463 | fflig: 'ff', 1464 | ffllig: 'ffl', 1465 | Ffr: '𝔉', 1466 | ffr: '𝔣', 1467 | filig: 'fi', 1468 | FilledSmallSquare: '◼', 1469 | FilledVerySmallSquare: '▪', 1470 | fjlig: 'f', 1471 | flat: '♭', 1472 | fllig: 'fl', 1473 | fltns: '▱', 1474 | fnof: 'ƒ', 1475 | Fopf: '𝔽', 1476 | fopf: '𝕗', 1477 | forall: '∀', 1478 | ForAll: '∀', 1479 | fork: '⋔', 1480 | forkv: '⫙', 1481 | Fouriertrf: 'ℱ', 1482 | fpartint: '⨍', 1483 | frac12: '½', 1484 | frac13: '⅓', 1485 | frac14: '¼', 1486 | frac15: '⅕', 1487 | frac16: '⅙', 1488 | frac18: '⅛', 1489 | frac23: '⅔', 1490 | frac25: '⅖', 1491 | frac34: '¾', 1492 | frac35: '⅗', 1493 | frac38: '⅜', 1494 | frac45: '⅘', 1495 | frac56: '⅚', 1496 | frac58: '⅝', 1497 | frac78: '⅞', 1498 | frasl: '⁄', 1499 | frown: '⌢', 1500 | fscr: '𝒻', 1501 | Fscr: 'ℱ', 1502 | gacute: 'ǵ', 1503 | Gamma: 'Γ', 1504 | gamma: 'γ', 1505 | Gammad: 'Ϝ', 1506 | gammad: 'ϝ', 1507 | gap: '⪆', 1508 | Gbreve: 'Ğ', 1509 | gbreve: 'ğ', 1510 | Gcedil: 'Ģ', 1511 | Gcirc: 'Ĝ', 1512 | gcirc: 'ĝ', 1513 | Gcy: 'Г', 1514 | gcy: 'г', 1515 | Gdot: 'Ġ', 1516 | gdot: 'ġ', 1517 | ge: '≥', 1518 | gE: '≧', 1519 | gEl: '⪌', 1520 | gel: '⋛', 1521 | geq: '≥', 1522 | geqq: '≧', 1523 | geqslant: '⩾', 1524 | gescc: '⪩', 1525 | ges: '⩾', 1526 | gesdot: '⪀', 1527 | gesdoto: '⪂', 1528 | gesdotol: '⪄', 1529 | gesl: '⋛', 1530 | gesles: '⪔', 1531 | Gfr: '𝔊', 1532 | gfr: '𝔤', 1533 | gg: '≫', 1534 | Gg: '⋙', 1535 | ggg: '⋙', 1536 | gimel: 'ℷ', 1537 | GJcy: 'Ѓ', 1538 | gjcy: 'ѓ', 1539 | gla: '⪥', 1540 | gl: '≷', 1541 | glE: '⪒', 1542 | glj: '⪤', 1543 | gnap: '⪊', 1544 | gnapprox: '⪊', 1545 | gne: '⪈', 1546 | gnE: '≩', 1547 | gneq: '⪈', 1548 | gneqq: '≩', 1549 | gnsim: '⋧', 1550 | Gopf: '𝔾', 1551 | gopf: '𝕘', 1552 | grave: '`', 1553 | GreaterEqual: '≥', 1554 | GreaterEqualLess: '⋛', 1555 | GreaterFullEqual: '≧', 1556 | GreaterGreater: '⪢', 1557 | GreaterLess: '≷', 1558 | GreaterSlantEqual: '⩾', 1559 | GreaterTilde: '≳', 1560 | Gscr: '𝒢', 1561 | gscr: 'ℊ', 1562 | gsim: '≳', 1563 | gsime: '⪎', 1564 | gsiml: '⪐', 1565 | gtcc: '⪧', 1566 | gtcir: '⩺', 1567 | gt: '>', 1568 | GT: '>', 1569 | Gt: '≫', 1570 | gtdot: '⋗', 1571 | gtlPar: '⦕', 1572 | gtquest: '⩼', 1573 | gtrapprox: '⪆', 1574 | gtrarr: '⥸', 1575 | gtrdot: '⋗', 1576 | gtreqless: '⋛', 1577 | gtreqqless: '⪌', 1578 | gtrless: '≷', 1579 | gtrsim: '≳', 1580 | gvertneqq: '≩', 1581 | gvnE: '≩', 1582 | Hacek: 'ˇ', 1583 | hairsp: ' ', 1584 | half: '½', 1585 | hamilt: 'ℋ', 1586 | HARDcy: 'Ъ', 1587 | hardcy: 'ъ', 1588 | harrcir: '⥈', 1589 | harr: '↔', 1590 | hArr: '⇔', 1591 | harrw: '↭', 1592 | Hat: '^', 1593 | hbar: 'ℏ', 1594 | Hcirc: 'Ĥ', 1595 | hcirc: 'ĥ', 1596 | hearts: '♥', 1597 | heartsuit: '♥', 1598 | hellip: '…', 1599 | hercon: '⊹', 1600 | hfr: '𝔥', 1601 | Hfr: 'ℌ', 1602 | HilbertSpace: 'ℋ', 1603 | hksearow: '⤥', 1604 | hkswarow: '⤦', 1605 | hoarr: '⇿', 1606 | homtht: '∻', 1607 | hookleftarrow: '↩', 1608 | hookrightarrow: '↪', 1609 | hopf: '𝕙', 1610 | Hopf: 'ℍ', 1611 | horbar: '―', 1612 | HorizontalLine: '─', 1613 | hscr: '𝒽', 1614 | Hscr: 'ℋ', 1615 | hslash: 'ℏ', 1616 | Hstrok: 'Ħ', 1617 | hstrok: 'ħ', 1618 | HumpDownHump: '≎', 1619 | HumpEqual: '≏', 1620 | hybull: '⁃', 1621 | hyphen: '‐', 1622 | Iacute: 'Í', 1623 | iacute: 'í', 1624 | ic: '⁣', 1625 | Icirc: 'Î', 1626 | icirc: 'î', 1627 | Icy: 'И', 1628 | icy: 'и', 1629 | Idot: 'İ', 1630 | IEcy: 'Е', 1631 | iecy: 'е', 1632 | iexcl: '¡', 1633 | iff: '⇔', 1634 | ifr: '𝔦', 1635 | Ifr: 'ℑ', 1636 | Igrave: 'Ì', 1637 | igrave: 'ì', 1638 | ii: 'ⅈ', 1639 | iiiint: '⨌', 1640 | iiint: '∭', 1641 | iinfin: '⧜', 1642 | iiota: '℩', 1643 | IJlig: 'IJ', 1644 | ijlig: 'ij', 1645 | Imacr: 'Ī', 1646 | imacr: 'ī', 1647 | image: 'ℑ', 1648 | ImaginaryI: 'ⅈ', 1649 | imagline: 'ℐ', 1650 | imagpart: 'ℑ', 1651 | imath: 'ı', 1652 | Im: 'ℑ', 1653 | imof: '⊷', 1654 | imped: 'Ƶ', 1655 | Implies: '⇒', 1656 | incare: '℅', 1657 | in: '∈', 1658 | infin: '∞', 1659 | infintie: '⧝', 1660 | inodot: 'ı', 1661 | intcal: '⊺', 1662 | int: '∫', 1663 | Int: '∬', 1664 | integers: 'ℤ', 1665 | Integral: '∫', 1666 | intercal: '⊺', 1667 | Intersection: '⋂', 1668 | intlarhk: '⨗', 1669 | intprod: '⨼', 1670 | InvisibleComma: '⁣', 1671 | InvisibleTimes: '⁢', 1672 | IOcy: 'Ё', 1673 | iocy: 'ё', 1674 | Iogon: 'Į', 1675 | iogon: 'į', 1676 | Iopf: '𝕀', 1677 | iopf: '𝕚', 1678 | Iota: 'Ι', 1679 | iota: 'ι', 1680 | iprod: '⨼', 1681 | iquest: '¿', 1682 | iscr: '𝒾', 1683 | Iscr: 'ℐ', 1684 | isin: '∈', 1685 | isindot: '⋵', 1686 | isinE: '⋹', 1687 | isins: '⋴', 1688 | isinsv: '⋳', 1689 | isinv: '∈', 1690 | it: '⁢', 1691 | Itilde: 'Ĩ', 1692 | itilde: 'ĩ', 1693 | Iukcy: 'І', 1694 | iukcy: 'і', 1695 | Iuml: 'Ï', 1696 | iuml: 'ï', 1697 | Jcirc: 'Ĵ', 1698 | jcirc: 'ĵ', 1699 | Jcy: 'Й', 1700 | jcy: 'й', 1701 | Jfr: '𝔍', 1702 | jfr: '𝔧', 1703 | jmath: 'ȷ', 1704 | Jopf: '𝕁', 1705 | jopf: '𝕛', 1706 | Jscr: '𝒥', 1707 | jscr: '𝒿', 1708 | Jsercy: 'Ј', 1709 | jsercy: 'ј', 1710 | Jukcy: 'Є', 1711 | jukcy: 'є', 1712 | Kappa: 'Κ', 1713 | kappa: 'κ', 1714 | kappav: 'ϰ', 1715 | Kcedil: 'Ķ', 1716 | kcedil: 'ķ', 1717 | Kcy: 'К', 1718 | kcy: 'к', 1719 | Kfr: '𝔎', 1720 | kfr: '𝔨', 1721 | kgreen: 'ĸ', 1722 | KHcy: 'Х', 1723 | khcy: 'х', 1724 | KJcy: 'Ќ', 1725 | kjcy: 'ќ', 1726 | Kopf: '𝕂', 1727 | kopf: '𝕜', 1728 | Kscr: '𝒦', 1729 | kscr: '𝓀', 1730 | lAarr: '⇚', 1731 | Lacute: 'Ĺ', 1732 | lacute: 'ĺ', 1733 | laemptyv: '⦴', 1734 | lagran: 'ℒ', 1735 | Lambda: 'Λ', 1736 | lambda: 'λ', 1737 | lang: '⟨', 1738 | Lang: '⟪', 1739 | langd: '⦑', 1740 | langle: '⟨', 1741 | lap: '⪅', 1742 | Laplacetrf: 'ℒ', 1743 | laquo: '«', 1744 | larrb: '⇤', 1745 | larrbfs: '⤟', 1746 | larr: '←', 1747 | Larr: '↞', 1748 | lArr: '⇐', 1749 | larrfs: '⤝', 1750 | larrhk: '↩', 1751 | larrlp: '↫', 1752 | larrpl: '⤹', 1753 | larrsim: '⥳', 1754 | larrtl: '↢', 1755 | latail: '⤙', 1756 | lAtail: '⤛', 1757 | lat: '⪫', 1758 | late: '⪭', 1759 | lates: '⪭', 1760 | lbarr: '⤌', 1761 | lBarr: '⤎', 1762 | lbbrk: '❲', 1763 | lbrace: '{', 1764 | lbrack: '[', 1765 | lbrke: '⦋', 1766 | lbrksld: '⦏', 1767 | lbrkslu: '⦍', 1768 | Lcaron: 'Ľ', 1769 | lcaron: 'ľ', 1770 | Lcedil: 'Ļ', 1771 | lcedil: 'ļ', 1772 | lceil: '⌈', 1773 | lcub: '{', 1774 | Lcy: 'Л', 1775 | lcy: 'л', 1776 | ldca: '⤶', 1777 | ldquo: '“', 1778 | ldquor: '„', 1779 | ldrdhar: '⥧', 1780 | ldrushar: '⥋', 1781 | ldsh: '↲', 1782 | le: '≤', 1783 | lE: '≦', 1784 | LeftAngleBracket: '⟨', 1785 | LeftArrowBar: '⇤', 1786 | leftarrow: '←', 1787 | LeftArrow: '←', 1788 | Leftarrow: '⇐', 1789 | LeftArrowRightArrow: '⇆', 1790 | leftarrowtail: '↢', 1791 | LeftCeiling: '⌈', 1792 | LeftDoubleBracket: '⟦', 1793 | LeftDownTeeVector: '⥡', 1794 | LeftDownVectorBar: '⥙', 1795 | LeftDownVector: '⇃', 1796 | LeftFloor: '⌊', 1797 | leftharpoondown: '↽', 1798 | leftharpoonup: '↼', 1799 | leftleftarrows: '⇇', 1800 | leftrightarrow: '↔', 1801 | LeftRightArrow: '↔', 1802 | Leftrightarrow: '⇔', 1803 | leftrightarrows: '⇆', 1804 | leftrightharpoons: '⇋', 1805 | leftrightsquigarrow: '↭', 1806 | LeftRightVector: '⥎', 1807 | LeftTeeArrow: '↤', 1808 | LeftTee: '⊣', 1809 | LeftTeeVector: '⥚', 1810 | leftthreetimes: '⋋', 1811 | LeftTriangleBar: '⧏', 1812 | LeftTriangle: '⊲', 1813 | LeftTriangleEqual: '⊴', 1814 | LeftUpDownVector: '⥑', 1815 | LeftUpTeeVector: '⥠', 1816 | LeftUpVectorBar: '⥘', 1817 | LeftUpVector: '↿', 1818 | LeftVectorBar: '⥒', 1819 | LeftVector: '↼', 1820 | lEg: '⪋', 1821 | leg: '⋚', 1822 | leq: '≤', 1823 | leqq: '≦', 1824 | leqslant: '⩽', 1825 | lescc: '⪨', 1826 | les: '⩽', 1827 | lesdot: '⩿', 1828 | lesdoto: '⪁', 1829 | lesdotor: '⪃', 1830 | lesg: '⋚', 1831 | lesges: '⪓', 1832 | lessapprox: '⪅', 1833 | lessdot: '⋖', 1834 | lesseqgtr: '⋚', 1835 | lesseqqgtr: '⪋', 1836 | LessEqualGreater: '⋚', 1837 | LessFullEqual: '≦', 1838 | LessGreater: '≶', 1839 | lessgtr: '≶', 1840 | LessLess: '⪡', 1841 | lesssim: '≲', 1842 | LessSlantEqual: '⩽', 1843 | LessTilde: '≲', 1844 | lfisht: '⥼', 1845 | lfloor: '⌊', 1846 | Lfr: '𝔏', 1847 | lfr: '𝔩', 1848 | lg: '≶', 1849 | lgE: '⪑', 1850 | lHar: '⥢', 1851 | lhard: '↽', 1852 | lharu: '↼', 1853 | lharul: '⥪', 1854 | lhblk: '▄', 1855 | LJcy: 'Љ', 1856 | ljcy: 'љ', 1857 | llarr: '⇇', 1858 | ll: '≪', 1859 | Ll: '⋘', 1860 | llcorner: '⌞', 1861 | Lleftarrow: '⇚', 1862 | llhard: '⥫', 1863 | lltri: '◺', 1864 | Lmidot: 'Ŀ', 1865 | lmidot: 'ŀ', 1866 | lmoustache: '⎰', 1867 | lmoust: '⎰', 1868 | lnap: '⪉', 1869 | lnapprox: '⪉', 1870 | lne: '⪇', 1871 | lnE: '≨', 1872 | lneq: '⪇', 1873 | lneqq: '≨', 1874 | lnsim: '⋦', 1875 | loang: '⟬', 1876 | loarr: '⇽', 1877 | lobrk: '⟦', 1878 | longleftarrow: '⟵', 1879 | LongLeftArrow: '⟵', 1880 | Longleftarrow: '⟸', 1881 | longleftrightarrow: '⟷', 1882 | LongLeftRightArrow: '⟷', 1883 | Longleftrightarrow: '⟺', 1884 | longmapsto: '⟼', 1885 | longrightarrow: '⟶', 1886 | LongRightArrow: '⟶', 1887 | Longrightarrow: '⟹', 1888 | looparrowleft: '↫', 1889 | looparrowright: '↬', 1890 | lopar: '⦅', 1891 | Lopf: '𝕃', 1892 | lopf: '𝕝', 1893 | loplus: '⨭', 1894 | lotimes: '⨴', 1895 | lowast: '∗', 1896 | lowbar: '_', 1897 | LowerLeftArrow: '↙', 1898 | LowerRightArrow: '↘', 1899 | loz: '◊', 1900 | lozenge: '◊', 1901 | lozf: '⧫', 1902 | lpar: '(', 1903 | lparlt: '⦓', 1904 | lrarr: '⇆', 1905 | lrcorner: '⌟', 1906 | lrhar: '⇋', 1907 | lrhard: '⥭', 1908 | lrm: '‎', 1909 | lrtri: '⊿', 1910 | lsaquo: '‹', 1911 | lscr: '𝓁', 1912 | Lscr: 'ℒ', 1913 | lsh: '↰', 1914 | Lsh: '↰', 1915 | lsim: '≲', 1916 | lsime: '⪍', 1917 | lsimg: '⪏', 1918 | lsqb: '[', 1919 | lsquo: '‘', 1920 | lsquor: '‚', 1921 | Lstrok: 'Ł', 1922 | lstrok: 'ł', 1923 | ltcc: '⪦', 1924 | ltcir: '⩹', 1925 | lt: '<', 1926 | LT: '<', 1927 | Lt: '≪', 1928 | ltdot: '⋖', 1929 | lthree: '⋋', 1930 | ltimes: '⋉', 1931 | ltlarr: '⥶', 1932 | ltquest: '⩻', 1933 | ltri: '◃', 1934 | ltrie: '⊴', 1935 | ltrif: '◂', 1936 | ltrPar: '⦖', 1937 | lurdshar: '⥊', 1938 | luruhar: '⥦', 1939 | lvertneqq: '≨', 1940 | lvnE: '≨', 1941 | macr: '¯', 1942 | male: '♂', 1943 | malt: '✠', 1944 | maltese: '✠', 1945 | Map: '⤅', 1946 | map: '↦', 1947 | mapsto: '↦', 1948 | mapstodown: '↧', 1949 | mapstoleft: '↤', 1950 | mapstoup: '↥', 1951 | marker: '▮', 1952 | mcomma: '⨩', 1953 | Mcy: 'М', 1954 | mcy: 'м', 1955 | mdash: '—', 1956 | mDDot: '∺', 1957 | measuredangle: '∡', 1958 | MediumSpace: ' ', 1959 | Mellintrf: 'ℳ', 1960 | Mfr: '𝔐', 1961 | mfr: '𝔪', 1962 | mho: '℧', 1963 | micro: 'µ', 1964 | midast: '*', 1965 | midcir: '⫰', 1966 | mid: '∣', 1967 | middot: '·', 1968 | minusb: '⊟', 1969 | minus: '−', 1970 | minusd: '∸', 1971 | minusdu: '⨪', 1972 | MinusPlus: '∓', 1973 | mlcp: '⫛', 1974 | mldr: '…', 1975 | mnplus: '∓', 1976 | models: '⊧', 1977 | Mopf: '𝕄', 1978 | mopf: '𝕞', 1979 | mp: '∓', 1980 | mscr: '𝓂', 1981 | Mscr: 'ℳ', 1982 | mstpos: '∾', 1983 | Mu: 'Μ', 1984 | mu: 'μ', 1985 | multimap: '⊸', 1986 | mumap: '⊸', 1987 | nabla: '∇', 1988 | Nacute: 'Ń', 1989 | nacute: 'ń', 1990 | nang: '∠', 1991 | nap: '≉', 1992 | napE: '⩰', 1993 | napid: '≋', 1994 | napos: 'ʼn', 1995 | napprox: '≉', 1996 | natural: '♮', 1997 | naturals: 'ℕ', 1998 | natur: '♮', 1999 | nbsp: ' ', 2000 | nbump: '≎', 2001 | nbumpe: '≏', 2002 | ncap: '⩃', 2003 | Ncaron: 'Ň', 2004 | ncaron: 'ň', 2005 | Ncedil: 'Ņ', 2006 | ncedil: 'ņ', 2007 | ncong: '≇', 2008 | ncongdot: '⩭', 2009 | ncup: '⩂', 2010 | Ncy: 'Н', 2011 | ncy: 'н', 2012 | ndash: '–', 2013 | nearhk: '⤤', 2014 | nearr: '↗', 2015 | neArr: '⇗', 2016 | nearrow: '↗', 2017 | ne: '≠', 2018 | nedot: '≐', 2019 | NegativeMediumSpace: '​', 2020 | NegativeThickSpace: '​', 2021 | NegativeThinSpace: '​', 2022 | NegativeVeryThinSpace: '​', 2023 | nequiv: '≢', 2024 | nesear: '⤨', 2025 | nesim: '≂', 2026 | NestedGreaterGreater: '≫', 2027 | NestedLessLess: '≪', 2028 | NewLine: '\n', 2029 | nexist: '∄', 2030 | nexists: '∄', 2031 | Nfr: '𝔑', 2032 | nfr: '𝔫', 2033 | ngE: '≧', 2034 | nge: '≱', 2035 | ngeq: '≱', 2036 | ngeqq: '≧', 2037 | ngeqslant: '⩾', 2038 | nges: '⩾', 2039 | nGg: '⋙', 2040 | ngsim: '≵', 2041 | nGt: '≫', 2042 | ngt: '≯', 2043 | ngtr: '≯', 2044 | nGtv: '≫', 2045 | nharr: '↮', 2046 | nhArr: '⇎', 2047 | nhpar: '⫲', 2048 | ni: '∋', 2049 | nis: '⋼', 2050 | nisd: '⋺', 2051 | niv: '∋', 2052 | NJcy: 'Њ', 2053 | njcy: 'њ', 2054 | nlarr: '↚', 2055 | nlArr: '⇍', 2056 | nldr: '‥', 2057 | nlE: '≦', 2058 | nle: '≰', 2059 | nleftarrow: '↚', 2060 | nLeftarrow: '⇍', 2061 | nleftrightarrow: '↮', 2062 | nLeftrightarrow: '⇎', 2063 | nleq: '≰', 2064 | nleqq: '≦', 2065 | nleqslant: '⩽', 2066 | nles: '⩽', 2067 | nless: '≮', 2068 | nLl: '⋘', 2069 | nlsim: '≴', 2070 | nLt: '≪', 2071 | nlt: '≮', 2072 | nltri: '⋪', 2073 | nltrie: '⋬', 2074 | nLtv: '≪', 2075 | nmid: '∤', 2076 | NoBreak: '⁠', 2077 | NonBreakingSpace: ' ', 2078 | nopf: '𝕟', 2079 | Nopf: 'ℕ', 2080 | Not: '⫬', 2081 | not: '¬', 2082 | NotCongruent: '≢', 2083 | NotCupCap: '≭', 2084 | NotDoubleVerticalBar: '∦', 2085 | NotElement: '∉', 2086 | NotEqual: '≠', 2087 | NotEqualTilde: '≂', 2088 | NotExists: '∄', 2089 | NotGreater: '≯', 2090 | NotGreaterEqual: '≱', 2091 | NotGreaterFullEqual: '≧', 2092 | NotGreaterGreater: '≫', 2093 | NotGreaterLess: '≹', 2094 | NotGreaterSlantEqual: '⩾', 2095 | NotGreaterTilde: '≵', 2096 | NotHumpDownHump: '≎', 2097 | NotHumpEqual: '≏', 2098 | notin: '∉', 2099 | notindot: '⋵', 2100 | notinE: '⋹', 2101 | notinva: '∉', 2102 | notinvb: '⋷', 2103 | notinvc: '⋶', 2104 | NotLeftTriangleBar: '⧏', 2105 | NotLeftTriangle: '⋪', 2106 | NotLeftTriangleEqual: '⋬', 2107 | NotLess: '≮', 2108 | NotLessEqual: '≰', 2109 | NotLessGreater: '≸', 2110 | NotLessLess: '≪', 2111 | NotLessSlantEqual: '⩽', 2112 | NotLessTilde: '≴', 2113 | NotNestedGreaterGreater: '⪢', 2114 | NotNestedLessLess: '⪡', 2115 | notni: '∌', 2116 | notniva: '∌', 2117 | notnivb: '⋾', 2118 | notnivc: '⋽', 2119 | NotPrecedes: '⊀', 2120 | NotPrecedesEqual: '⪯', 2121 | NotPrecedesSlantEqual: '⋠', 2122 | NotReverseElement: '∌', 2123 | NotRightTriangleBar: '⧐', 2124 | NotRightTriangle: '⋫', 2125 | NotRightTriangleEqual: '⋭', 2126 | NotSquareSubset: '⊏', 2127 | NotSquareSubsetEqual: '⋢', 2128 | NotSquareSuperset: '⊐', 2129 | NotSquareSupersetEqual: '⋣', 2130 | NotSubset: '⊂', 2131 | NotSubsetEqual: '⊈', 2132 | NotSucceeds: '⊁', 2133 | NotSucceedsEqual: '⪰', 2134 | NotSucceedsSlantEqual: '⋡', 2135 | NotSucceedsTilde: '≿', 2136 | NotSuperset: '⊃', 2137 | NotSupersetEqual: '⊉', 2138 | NotTilde: '≁', 2139 | NotTildeEqual: '≄', 2140 | NotTildeFullEqual: '≇', 2141 | NotTildeTilde: '≉', 2142 | NotVerticalBar: '∤', 2143 | nparallel: '∦', 2144 | npar: '∦', 2145 | nparsl: '⫽', 2146 | npart: '∂', 2147 | npolint: '⨔', 2148 | npr: '⊀', 2149 | nprcue: '⋠', 2150 | nprec: '⊀', 2151 | npreceq: '⪯', 2152 | npre: '⪯', 2153 | nrarrc: '⤳', 2154 | nrarr: '↛', 2155 | nrArr: '⇏', 2156 | nrarrw: '↝', 2157 | nrightarrow: '↛', 2158 | nRightarrow: '⇏', 2159 | nrtri: '⋫', 2160 | nrtrie: '⋭', 2161 | nsc: '⊁', 2162 | nsccue: '⋡', 2163 | nsce: '⪰', 2164 | Nscr: '𝒩', 2165 | nscr: '𝓃', 2166 | nshortmid: '∤', 2167 | nshortparallel: '∦', 2168 | nsim: '≁', 2169 | nsime: '≄', 2170 | nsimeq: '≄', 2171 | nsmid: '∤', 2172 | nspar: '∦', 2173 | nsqsube: '⋢', 2174 | nsqsupe: '⋣', 2175 | nsub: '⊄', 2176 | nsubE: '⫅', 2177 | nsube: '⊈', 2178 | nsubset: '⊂', 2179 | nsubseteq: '⊈', 2180 | nsubseteqq: '⫅', 2181 | nsucc: '⊁', 2182 | nsucceq: '⪰', 2183 | nsup: '⊅', 2184 | nsupE: '⫆', 2185 | nsupe: '⊉', 2186 | nsupset: '⊃', 2187 | nsupseteq: '⊉', 2188 | nsupseteqq: '⫆', 2189 | ntgl: '≹', 2190 | Ntilde: 'Ñ', 2191 | ntilde: 'ñ', 2192 | ntlg: '≸', 2193 | ntriangleleft: '⋪', 2194 | ntrianglelefteq: '⋬', 2195 | ntriangleright: '⋫', 2196 | ntrianglerighteq: '⋭', 2197 | Nu: 'Ν', 2198 | nu: 'ν', 2199 | num: '#', 2200 | numero: '№', 2201 | numsp: ' ', 2202 | nvap: '≍', 2203 | nvdash: '⊬', 2204 | nvDash: '⊭', 2205 | nVdash: '⊮', 2206 | nVDash: '⊯', 2207 | nvge: '≥', 2208 | nvgt: '>', 2209 | nvHarr: '⤄', 2210 | nvinfin: '⧞', 2211 | nvlArr: '⤂', 2212 | nvle: '≤', 2213 | nvlt: '>', 2214 | nvltrie: '⊴', 2215 | nvrArr: '⤃', 2216 | nvrtrie: '⊵', 2217 | nvsim: '∼', 2218 | nwarhk: '⤣', 2219 | nwarr: '↖', 2220 | nwArr: '⇖', 2221 | nwarrow: '↖', 2222 | nwnear: '⤧', 2223 | Oacute: 'Ó', 2224 | oacute: 'ó', 2225 | oast: '⊛', 2226 | Ocirc: 'Ô', 2227 | ocirc: 'ô', 2228 | ocir: '⊚', 2229 | Ocy: 'О', 2230 | ocy: 'о', 2231 | odash: '⊝', 2232 | Odblac: 'Ő', 2233 | odblac: 'ő', 2234 | odiv: '⨸', 2235 | odot: '⊙', 2236 | odsold: '⦼', 2237 | OElig: 'Œ', 2238 | oelig: 'œ', 2239 | ofcir: '⦿', 2240 | Ofr: '𝔒', 2241 | ofr: '𝔬', 2242 | ogon: '˛', 2243 | Ograve: 'Ò', 2244 | ograve: 'ò', 2245 | ogt: '⧁', 2246 | ohbar: '⦵', 2247 | ohm: 'Ω', 2248 | oint: '∮', 2249 | olarr: '↺', 2250 | olcir: '⦾', 2251 | olcross: '⦻', 2252 | oline: '‾', 2253 | olt: '⧀', 2254 | Omacr: 'Ō', 2255 | omacr: 'ō', 2256 | Omega: 'Ω', 2257 | omega: 'ω', 2258 | Omicron: 'Ο', 2259 | omicron: 'ο', 2260 | omid: '⦶', 2261 | ominus: '⊖', 2262 | Oopf: '𝕆', 2263 | oopf: '𝕠', 2264 | opar: '⦷', 2265 | OpenCurlyDoubleQuote: '“', 2266 | OpenCurlyQuote: '‘', 2267 | operp: '⦹', 2268 | oplus: '⊕', 2269 | orarr: '↻', 2270 | Or: '⩔', 2271 | or: '∨', 2272 | ord: '⩝', 2273 | order: 'ℴ', 2274 | orderof: 'ℴ', 2275 | ordf: 'ª', 2276 | ordm: 'º', 2277 | origof: '⊶', 2278 | oror: '⩖', 2279 | orslope: '⩗', 2280 | orv: '⩛', 2281 | oS: 'Ⓢ', 2282 | Oscr: '𝒪', 2283 | oscr: 'ℴ', 2284 | Oslash: 'Ø', 2285 | oslash: 'ø', 2286 | osol: '⊘', 2287 | Otilde: 'Õ', 2288 | otilde: 'õ', 2289 | otimesas: '⨶', 2290 | Otimes: '⨷', 2291 | otimes: '⊗', 2292 | Ouml: 'Ö', 2293 | ouml: 'ö', 2294 | ovbar: '⌽', 2295 | OverBar: '‾', 2296 | OverBrace: '⏞', 2297 | OverBracket: '⎴', 2298 | OverParenthesis: '⏜', 2299 | para: '¶', 2300 | parallel: '∥', 2301 | par: '∥', 2302 | parsim: '⫳', 2303 | parsl: '⫽', 2304 | part: '∂', 2305 | PartialD: '∂', 2306 | Pcy: 'П', 2307 | pcy: 'п', 2308 | percnt: '%', 2309 | period: '.', 2310 | permil: '‰', 2311 | perp: '⊥', 2312 | pertenk: '‱', 2313 | Pfr: '𝔓', 2314 | pfr: '𝔭', 2315 | Phi: 'Φ', 2316 | phi: 'φ', 2317 | phiv: 'ϕ', 2318 | phmmat: 'ℳ', 2319 | phone: '☎', 2320 | Pi: 'Π', 2321 | pi: 'π', 2322 | pitchfork: '⋔', 2323 | piv: 'ϖ', 2324 | planck: 'ℏ', 2325 | planckh: 'ℎ', 2326 | plankv: 'ℏ', 2327 | plusacir: '⨣', 2328 | plusb: '⊞', 2329 | pluscir: '⨢', 2330 | plus: '+', 2331 | plusdo: '∔', 2332 | plusdu: '⨥', 2333 | pluse: '⩲', 2334 | PlusMinus: '±', 2335 | plusmn: '±', 2336 | plussim: '⨦', 2337 | plustwo: '⨧', 2338 | pm: '±', 2339 | Poincareplane: 'ℌ', 2340 | pointint: '⨕', 2341 | popf: '𝕡', 2342 | Popf: 'ℙ', 2343 | pound: '£', 2344 | prap: '⪷', 2345 | Pr: '⪻', 2346 | pr: '≺', 2347 | prcue: '≼', 2348 | precapprox: '⪷', 2349 | prec: '≺', 2350 | preccurlyeq: '≼', 2351 | Precedes: '≺', 2352 | PrecedesEqual: '⪯', 2353 | PrecedesSlantEqual: '≼', 2354 | PrecedesTilde: '≾', 2355 | preceq: '⪯', 2356 | precnapprox: '⪹', 2357 | precneqq: '⪵', 2358 | precnsim: '⋨', 2359 | pre: '⪯', 2360 | prE: '⪳', 2361 | precsim: '≾', 2362 | prime: '′', 2363 | Prime: '″', 2364 | primes: 'ℙ', 2365 | prnap: '⪹', 2366 | prnE: '⪵', 2367 | prnsim: '⋨', 2368 | prod: '∏', 2369 | Product: '∏', 2370 | profalar: '⌮', 2371 | profline: '⌒', 2372 | profsurf: '⌓', 2373 | prop: '∝', 2374 | Proportional: '∝', 2375 | Proportion: '∷', 2376 | propto: '∝', 2377 | prsim: '≾', 2378 | prurel: '⊰', 2379 | Pscr: '𝒫', 2380 | pscr: '𝓅', 2381 | Psi: 'Ψ', 2382 | psi: 'ψ', 2383 | puncsp: ' ', 2384 | Qfr: '𝔔', 2385 | qfr: '𝔮', 2386 | qint: '⨌', 2387 | qopf: '𝕢', 2388 | Qopf: 'ℚ', 2389 | qprime: '⁗', 2390 | Qscr: '𝒬', 2391 | qscr: '𝓆', 2392 | quaternions: 'ℍ', 2393 | quatint: '⨖', 2394 | quest: '?', 2395 | questeq: '≟', 2396 | quot: '"', 2397 | QUOT: '"', 2398 | rAarr: '⇛', 2399 | race: '∽', 2400 | Racute: 'Ŕ', 2401 | racute: 'ŕ', 2402 | radic: '√', 2403 | raemptyv: '⦳', 2404 | rang: '⟩', 2405 | Rang: '⟫', 2406 | rangd: '⦒', 2407 | range: '⦥', 2408 | rangle: '⟩', 2409 | raquo: '»', 2410 | rarrap: '⥵', 2411 | rarrb: '⇥', 2412 | rarrbfs: '⤠', 2413 | rarrc: '⤳', 2414 | rarr: '→', 2415 | Rarr: '↠', 2416 | rArr: '⇒', 2417 | rarrfs: '⤞', 2418 | rarrhk: '↪', 2419 | rarrlp: '↬', 2420 | rarrpl: '⥅', 2421 | rarrsim: '⥴', 2422 | Rarrtl: '⤖', 2423 | rarrtl: '↣', 2424 | rarrw: '↝', 2425 | ratail: '⤚', 2426 | rAtail: '⤜', 2427 | ratio: '∶', 2428 | rationals: 'ℚ', 2429 | rbarr: '⤍', 2430 | rBarr: '⤏', 2431 | RBarr: '⤐', 2432 | rbbrk: '❳', 2433 | rbrace: '}', 2434 | rbrack: ']', 2435 | rbrke: '⦌', 2436 | rbrksld: '⦎', 2437 | rbrkslu: '⦐', 2438 | Rcaron: 'Ř', 2439 | rcaron: 'ř', 2440 | Rcedil: 'Ŗ', 2441 | rcedil: 'ŗ', 2442 | rceil: '⌉', 2443 | rcub: '}', 2444 | Rcy: 'Р', 2445 | rcy: 'р', 2446 | rdca: '⤷', 2447 | rdldhar: '⥩', 2448 | rdquo: '”', 2449 | rdquor: '”', 2450 | rdsh: '↳', 2451 | real: 'ℜ', 2452 | realine: 'ℛ', 2453 | realpart: 'ℜ', 2454 | reals: 'ℝ', 2455 | Re: 'ℜ', 2456 | rect: '▭', 2457 | reg: '®', 2458 | REG: '®', 2459 | ReverseElement: '∋', 2460 | ReverseEquilibrium: '⇋', 2461 | ReverseUpEquilibrium: '⥯', 2462 | rfisht: '⥽', 2463 | rfloor: '⌋', 2464 | rfr: '𝔯', 2465 | Rfr: 'ℜ', 2466 | rHar: '⥤', 2467 | rhard: '⇁', 2468 | rharu: '⇀', 2469 | rharul: '⥬', 2470 | Rho: 'Ρ', 2471 | rho: 'ρ', 2472 | rhov: 'ϱ', 2473 | RightAngleBracket: '⟩', 2474 | RightArrowBar: '⇥', 2475 | rightarrow: '→', 2476 | RightArrow: '→', 2477 | Rightarrow: '⇒', 2478 | RightArrowLeftArrow: '⇄', 2479 | rightarrowtail: '↣', 2480 | RightCeiling: '⌉', 2481 | RightDoubleBracket: '⟧', 2482 | RightDownTeeVector: '⥝', 2483 | RightDownVectorBar: '⥕', 2484 | RightDownVector: '⇂', 2485 | RightFloor: '⌋', 2486 | rightharpoondown: '⇁', 2487 | rightharpoonup: '⇀', 2488 | rightleftarrows: '⇄', 2489 | rightleftharpoons: '⇌', 2490 | rightrightarrows: '⇉', 2491 | rightsquigarrow: '↝', 2492 | RightTeeArrow: '↦', 2493 | RightTee: '⊢', 2494 | RightTeeVector: '⥛', 2495 | rightthreetimes: '⋌', 2496 | RightTriangleBar: '⧐', 2497 | RightTriangle: '⊳', 2498 | RightTriangleEqual: '⊵', 2499 | RightUpDownVector: '⥏', 2500 | RightUpTeeVector: '⥜', 2501 | RightUpVectorBar: '⥔', 2502 | RightUpVector: '↾', 2503 | RightVectorBar: '⥓', 2504 | RightVector: '⇀', 2505 | ring: '˚', 2506 | risingdotseq: '≓', 2507 | rlarr: '⇄', 2508 | rlhar: '⇌', 2509 | rlm: '‏', 2510 | rmoustache: '⎱', 2511 | rmoust: '⎱', 2512 | rnmid: '⫮', 2513 | roang: '⟭', 2514 | roarr: '⇾', 2515 | robrk: '⟧', 2516 | ropar: '⦆', 2517 | ropf: '𝕣', 2518 | Ropf: 'ℝ', 2519 | roplus: '⨮', 2520 | rotimes: '⨵', 2521 | RoundImplies: '⥰', 2522 | rpar: ')', 2523 | rpargt: '⦔', 2524 | rppolint: '⨒', 2525 | rrarr: '⇉', 2526 | Rrightarrow: '⇛', 2527 | rsaquo: '›', 2528 | rscr: '𝓇', 2529 | Rscr: 'ℛ', 2530 | rsh: '↱', 2531 | Rsh: '↱', 2532 | rsqb: ']', 2533 | rsquo: '’', 2534 | rsquor: '’', 2535 | rthree: '⋌', 2536 | rtimes: '⋊', 2537 | rtri: '▹', 2538 | rtrie: '⊵', 2539 | rtrif: '▸', 2540 | rtriltri: '⧎', 2541 | RuleDelayed: '⧴', 2542 | ruluhar: '⥨', 2543 | rx: '℞', 2544 | Sacute: 'Ś', 2545 | sacute: 'ś', 2546 | sbquo: '‚', 2547 | scap: '⪸', 2548 | Scaron: 'Š', 2549 | scaron: 'š', 2550 | Sc: '⪼', 2551 | sc: '≻', 2552 | sccue: '≽', 2553 | sce: '⪰', 2554 | scE: '⪴', 2555 | Scedil: 'Ş', 2556 | scedil: 'ş', 2557 | Scirc: 'Ŝ', 2558 | scirc: 'ŝ', 2559 | scnap: '⪺', 2560 | scnE: '⪶', 2561 | scnsim: '⋩', 2562 | scpolint: '⨓', 2563 | scsim: '≿', 2564 | Scy: 'С', 2565 | scy: 'с', 2566 | sdotb: '⊡', 2567 | sdot: '⋅', 2568 | sdote: '⩦', 2569 | searhk: '⤥', 2570 | searr: '↘', 2571 | seArr: '⇘', 2572 | searrow: '↘', 2573 | sect: '§', 2574 | semi: ';', 2575 | seswar: '⤩', 2576 | setminus: '∖', 2577 | setmn: '∖', 2578 | sext: '✶', 2579 | Sfr: '𝔖', 2580 | sfr: '𝔰', 2581 | sfrown: '⌢', 2582 | sharp: '♯', 2583 | SHCHcy: 'Щ', 2584 | shchcy: 'щ', 2585 | SHcy: 'Ш', 2586 | shcy: 'ш', 2587 | ShortDownArrow: '↓', 2588 | ShortLeftArrow: '←', 2589 | shortmid: '∣', 2590 | shortparallel: '∥', 2591 | ShortRightArrow: '→', 2592 | ShortUpArrow: '↑', 2593 | shy: '­', 2594 | Sigma: 'Σ', 2595 | sigma: 'σ', 2596 | sigmaf: 'ς', 2597 | sigmav: 'ς', 2598 | sim: '∼', 2599 | simdot: '⩪', 2600 | sime: '≃', 2601 | simeq: '≃', 2602 | simg: '⪞', 2603 | simgE: '⪠', 2604 | siml: '⪝', 2605 | simlE: '⪟', 2606 | simne: '≆', 2607 | simplus: '⨤', 2608 | simrarr: '⥲', 2609 | slarr: '←', 2610 | SmallCircle: '∘', 2611 | smallsetminus: '∖', 2612 | smashp: '⨳', 2613 | smeparsl: '⧤', 2614 | smid: '∣', 2615 | smile: '⌣', 2616 | smt: '⪪', 2617 | smte: '⪬', 2618 | smtes: '⪬', 2619 | SOFTcy: 'Ь', 2620 | softcy: 'ь', 2621 | solbar: '⌿', 2622 | solb: '⧄', 2623 | sol: '/', 2624 | Sopf: '𝕊', 2625 | sopf: '𝕤', 2626 | spades: '♠', 2627 | spadesuit: '♠', 2628 | spar: '∥', 2629 | sqcap: '⊓', 2630 | sqcaps: '⊓', 2631 | sqcup: '⊔', 2632 | sqcups: '⊔', 2633 | Sqrt: '√', 2634 | sqsub: '⊏', 2635 | sqsube: '⊑', 2636 | sqsubset: '⊏', 2637 | sqsubseteq: '⊑', 2638 | sqsup: '⊐', 2639 | sqsupe: '⊒', 2640 | sqsupset: '⊐', 2641 | sqsupseteq: '⊒', 2642 | square: '□', 2643 | Square: '□', 2644 | SquareIntersection: '⊓', 2645 | SquareSubset: '⊏', 2646 | SquareSubsetEqual: '⊑', 2647 | SquareSuperset: '⊐', 2648 | SquareSupersetEqual: '⊒', 2649 | SquareUnion: '⊔', 2650 | squarf: '▪', 2651 | squ: '□', 2652 | squf: '▪', 2653 | srarr: '→', 2654 | Sscr: '𝒮', 2655 | sscr: '𝓈', 2656 | ssetmn: '∖', 2657 | ssmile: '⌣', 2658 | sstarf: '⋆', 2659 | Star: '⋆', 2660 | star: '☆', 2661 | starf: '★', 2662 | straightepsilon: 'ϵ', 2663 | straightphi: 'ϕ', 2664 | strns: '¯', 2665 | sub: '⊂', 2666 | Sub: '⋐', 2667 | subdot: '⪽', 2668 | subE: '⫅', 2669 | sube: '⊆', 2670 | subedot: '⫃', 2671 | submult: '⫁', 2672 | subnE: '⫋', 2673 | subne: '⊊', 2674 | subplus: '⪿', 2675 | subrarr: '⥹', 2676 | subset: '⊂', 2677 | Subset: '⋐', 2678 | subseteq: '⊆', 2679 | subseteqq: '⫅', 2680 | SubsetEqual: '⊆', 2681 | subsetneq: '⊊', 2682 | subsetneqq: '⫋', 2683 | subsim: '⫇', 2684 | subsub: '⫕', 2685 | subsup: '⫓', 2686 | succapprox: '⪸', 2687 | succ: '≻', 2688 | succcurlyeq: '≽', 2689 | Succeeds: '≻', 2690 | SucceedsEqual: '⪰', 2691 | SucceedsSlantEqual: '≽', 2692 | SucceedsTilde: '≿', 2693 | succeq: '⪰', 2694 | succnapprox: '⪺', 2695 | succneqq: '⪶', 2696 | succnsim: '⋩', 2697 | succsim: '≿', 2698 | SuchThat: '∋', 2699 | sum: '∑', 2700 | Sum: '∑', 2701 | sung: '♪', 2702 | sup1: '¹', 2703 | sup2: '²', 2704 | sup3: '³', 2705 | sup: '⊃', 2706 | Sup: '⋑', 2707 | supdot: '⪾', 2708 | supdsub: '⫘', 2709 | supE: '⫆', 2710 | supe: '⊇', 2711 | supedot: '⫄', 2712 | Superset: '⊃', 2713 | SupersetEqual: '⊇', 2714 | suphsol: '⟉', 2715 | suphsub: '⫗', 2716 | suplarr: '⥻', 2717 | supmult: '⫂', 2718 | supnE: '⫌', 2719 | supne: '⊋', 2720 | supplus: '⫀', 2721 | supset: '⊃', 2722 | Supset: '⋑', 2723 | supseteq: '⊇', 2724 | supseteqq: '⫆', 2725 | supsetneq: '⊋', 2726 | supsetneqq: '⫌', 2727 | supsim: '⫈', 2728 | supsub: '⫔', 2729 | supsup: '⫖', 2730 | swarhk: '⤦', 2731 | swarr: '↙', 2732 | swArr: '⇙', 2733 | swarrow: '↙', 2734 | swnwar: '⤪', 2735 | szlig: 'ß', 2736 | Tab: ' ', 2737 | target: '⌖', 2738 | Tau: 'Τ', 2739 | tau: 'τ', 2740 | tbrk: '⎴', 2741 | Tcaron: 'Ť', 2742 | tcaron: 'ť', 2743 | Tcedil: 'Ţ', 2744 | tcedil: 'ţ', 2745 | Tcy: 'Т', 2746 | tcy: 'т', 2747 | tdot: '⃛', 2748 | telrec: '⌕', 2749 | Tfr: '𝔗', 2750 | tfr: '𝔱', 2751 | there4: '∴', 2752 | therefore: '∴', 2753 | Therefore: '∴', 2754 | Theta: 'Θ', 2755 | theta: 'θ', 2756 | thetasym: 'ϑ', 2757 | thetav: 'ϑ', 2758 | thickapprox: '≈', 2759 | thicksim: '∼', 2760 | ThickSpace: ' ', 2761 | ThinSpace: ' ', 2762 | thinsp: ' ', 2763 | thkap: '≈', 2764 | thksim: '∼', 2765 | THORN: 'Þ', 2766 | thorn: 'þ', 2767 | tilde: '˜', 2768 | Tilde: '∼', 2769 | TildeEqual: '≃', 2770 | TildeFullEqual: '≅', 2771 | TildeTilde: '≈', 2772 | timesbar: '⨱', 2773 | timesb: '⊠', 2774 | times: '×', 2775 | timesd: '⨰', 2776 | tint: '∭', 2777 | toea: '⤨', 2778 | topbot: '⌶', 2779 | topcir: '⫱', 2780 | top: '⊤', 2781 | Topf: '𝕋', 2782 | topf: '𝕥', 2783 | topfork: '⫚', 2784 | tosa: '⤩', 2785 | tprime: '‴', 2786 | trade: '™', 2787 | TRADE: '™', 2788 | triangle: '▵', 2789 | triangledown: '▿', 2790 | triangleleft: '◃', 2791 | trianglelefteq: '⊴', 2792 | triangleq: '≜', 2793 | triangleright: '▹', 2794 | trianglerighteq: '⊵', 2795 | tridot: '◬', 2796 | trie: '≜', 2797 | triminus: '⨺', 2798 | TripleDot: '⃛', 2799 | triplus: '⨹', 2800 | trisb: '⧍', 2801 | tritime: '⨻', 2802 | trpezium: '⏢', 2803 | Tscr: '𝒯', 2804 | tscr: '𝓉', 2805 | TScy: 'Ц', 2806 | tscy: 'ц', 2807 | TSHcy: 'Ћ', 2808 | tshcy: 'ћ', 2809 | Tstrok: 'Ŧ', 2810 | tstrok: 'ŧ', 2811 | twixt: '≬', 2812 | twoheadleftarrow: '↞', 2813 | twoheadrightarrow: '↠', 2814 | Uacute: 'Ú', 2815 | uacute: 'ú', 2816 | uarr: '↑', 2817 | Uarr: '↟', 2818 | uArr: '⇑', 2819 | Uarrocir: '⥉', 2820 | Ubrcy: 'Ў', 2821 | ubrcy: 'ў', 2822 | Ubreve: 'Ŭ', 2823 | ubreve: 'ŭ', 2824 | Ucirc: 'Û', 2825 | ucirc: 'û', 2826 | Ucy: 'У', 2827 | ucy: 'у', 2828 | udarr: '⇅', 2829 | Udblac: 'Ű', 2830 | udblac: 'ű', 2831 | udhar: '⥮', 2832 | ufisht: '⥾', 2833 | Ufr: '𝔘', 2834 | ufr: '𝔲', 2835 | Ugrave: 'Ù', 2836 | ugrave: 'ù', 2837 | uHar: '⥣', 2838 | uharl: '↿', 2839 | uharr: '↾', 2840 | uhblk: '▀', 2841 | ulcorn: '⌜', 2842 | ulcorner: '⌜', 2843 | ulcrop: '⌏', 2844 | ultri: '◸', 2845 | Umacr: 'Ū', 2846 | umacr: 'ū', 2847 | uml: '¨', 2848 | UnderBar: '_', 2849 | UnderBrace: '⏟', 2850 | UnderBracket: '⎵', 2851 | UnderParenthesis: '⏝', 2852 | Union: '⋃', 2853 | UnionPlus: '⊎', 2854 | Uogon: 'Ų', 2855 | uogon: 'ų', 2856 | Uopf: '𝕌', 2857 | uopf: '𝕦', 2858 | UpArrowBar: '⤒', 2859 | uparrow: '↑', 2860 | UpArrow: '↑', 2861 | Uparrow: '⇑', 2862 | UpArrowDownArrow: '⇅', 2863 | updownarrow: '↕', 2864 | UpDownArrow: '↕', 2865 | Updownarrow: '⇕', 2866 | UpEquilibrium: '⥮', 2867 | upharpoonleft: '↿', 2868 | upharpoonright: '↾', 2869 | uplus: '⊎', 2870 | UpperLeftArrow: '↖', 2871 | UpperRightArrow: '↗', 2872 | upsi: 'υ', 2873 | Upsi: 'ϒ', 2874 | upsih: 'ϒ', 2875 | Upsilon: 'Υ', 2876 | upsilon: 'υ', 2877 | UpTeeArrow: '↥', 2878 | UpTee: '⊥', 2879 | upuparrows: '⇈', 2880 | urcorn: '⌝', 2881 | urcorner: '⌝', 2882 | urcrop: '⌎', 2883 | Uring: 'Ů', 2884 | uring: 'ů', 2885 | urtri: '◹', 2886 | Uscr: '𝒰', 2887 | uscr: '𝓊', 2888 | utdot: '⋰', 2889 | Utilde: 'Ũ', 2890 | utilde: 'ũ', 2891 | utri: '▵', 2892 | utrif: '▴', 2893 | uuarr: '⇈', 2894 | Uuml: 'Ü', 2895 | uuml: 'ü', 2896 | uwangle: '⦧', 2897 | vangrt: '⦜', 2898 | varepsilon: 'ϵ', 2899 | varkappa: 'ϰ', 2900 | varnothing: '∅', 2901 | varphi: 'ϕ', 2902 | varpi: 'ϖ', 2903 | varpropto: '∝', 2904 | varr: '↕', 2905 | vArr: '⇕', 2906 | varrho: 'ϱ', 2907 | varsigma: 'ς', 2908 | varsubsetneq: '⊊', 2909 | varsubsetneqq: '⫋', 2910 | varsupsetneq: '⊋', 2911 | varsupsetneqq: '⫌', 2912 | vartheta: 'ϑ', 2913 | vartriangleleft: '⊲', 2914 | vartriangleright: '⊳', 2915 | vBar: '⫨', 2916 | Vbar: '⫫', 2917 | vBarv: '⫩', 2918 | Vcy: 'В', 2919 | vcy: 'в', 2920 | vdash: '⊢', 2921 | vDash: '⊨', 2922 | Vdash: '⊩', 2923 | VDash: '⊫', 2924 | Vdashl: '⫦', 2925 | veebar: '⊻', 2926 | vee: '∨', 2927 | Vee: '⋁', 2928 | veeeq: '≚', 2929 | vellip: '⋮', 2930 | verbar: '|', 2931 | Verbar: '‖', 2932 | vert: '|', 2933 | Vert: '‖', 2934 | VerticalBar: '∣', 2935 | VerticalLine: '|', 2936 | VerticalSeparator: '❘', 2937 | VerticalTilde: '≀', 2938 | VeryThinSpace: ' ', 2939 | Vfr: '𝔙', 2940 | vfr: '𝔳', 2941 | vltri: '⊲', 2942 | vnsub: '⊂', 2943 | vnsup: '⊃', 2944 | Vopf: '𝕍', 2945 | vopf: '𝕧', 2946 | vprop: '∝', 2947 | vrtri: '⊳', 2948 | Vscr: '𝒱', 2949 | vscr: '𝓋', 2950 | vsubnE: '⫋', 2951 | vsubne: '⊊', 2952 | vsupnE: '⫌', 2953 | vsupne: '⊋', 2954 | Vvdash: '⊪', 2955 | vzigzag: '⦚', 2956 | Wcirc: 'Ŵ', 2957 | wcirc: 'ŵ', 2958 | wedbar: '⩟', 2959 | wedge: '∧', 2960 | Wedge: '⋀', 2961 | wedgeq: '≙', 2962 | weierp: '℘', 2963 | Wfr: '𝔚', 2964 | wfr: '𝔴', 2965 | Wopf: '𝕎', 2966 | wopf: '𝕨', 2967 | wp: '℘', 2968 | wr: '≀', 2969 | wreath: '≀', 2970 | Wscr: '𝒲', 2971 | wscr: '𝓌', 2972 | xcap: '⋂', 2973 | xcirc: '◯', 2974 | xcup: '⋃', 2975 | xdtri: '▽', 2976 | Xfr: '𝔛', 2977 | xfr: '𝔵', 2978 | xharr: '⟷', 2979 | xhArr: '⟺', 2980 | Xi: 'Ξ', 2981 | xi: 'ξ', 2982 | xlarr: '⟵', 2983 | xlArr: '⟸', 2984 | xmap: '⟼', 2985 | xnis: '⋻', 2986 | xodot: '⨀', 2987 | Xopf: '𝕏', 2988 | xopf: '𝕩', 2989 | xoplus: '⨁', 2990 | xotime: '⨂', 2991 | xrarr: '⟶', 2992 | xrArr: '⟹', 2993 | Xscr: '𝒳', 2994 | xscr: '𝓍', 2995 | xsqcup: '⨆', 2996 | xuplus: '⨄', 2997 | xutri: '△', 2998 | xvee: '⋁', 2999 | xwedge: '⋀', 3000 | Yacute: 'Ý', 3001 | yacute: 'ý', 3002 | YAcy: 'Я', 3003 | yacy: 'я', 3004 | Ycirc: 'Ŷ', 3005 | ycirc: 'ŷ', 3006 | Ycy: 'Ы', 3007 | ycy: 'ы', 3008 | yen: '¥', 3009 | Yfr: '𝔜', 3010 | yfr: '𝔶', 3011 | YIcy: 'Ї', 3012 | yicy: 'ї', 3013 | Yopf: '𝕐', 3014 | yopf: '𝕪', 3015 | Yscr: '𝒴', 3016 | yscr: '𝓎', 3017 | YUcy: 'Ю', 3018 | yucy: 'ю', 3019 | yuml: 'ÿ', 3020 | Yuml: 'Ÿ', 3021 | Zacute: 'Ź', 3022 | zacute: 'ź', 3023 | Zcaron: 'Ž', 3024 | zcaron: 'ž', 3025 | Zcy: 'З', 3026 | zcy: 'з', 3027 | Zdot: 'Ż', 3028 | zdot: 'ż', 3029 | zeetrf: 'ℨ', 3030 | ZeroWidthSpace: '​', 3031 | Zeta: 'Ζ', 3032 | zeta: 'ζ', 3033 | zfr: '𝔷', 3034 | Zfr: 'ℨ', 3035 | ZHcy: 'Ж', 3036 | zhcy: 'ж', 3037 | zigrarr: '⇝', 3038 | zopf: '𝕫', 3039 | Zopf: 'ℤ', 3040 | Zscr: '𝒵', 3041 | zscr: '𝓏', 3042 | zwj: '‍', 3043 | zwnj: '‌' }; 3044 | 3045 | var entityToChar = function(m) { 3046 | var isNumeric = /^&#/.test(m); 3047 | var isHex = /^&#[Xx]/.test(m); 3048 | var uchar; 3049 | if (isNumeric) { 3050 | var num; 3051 | if (isHex) { 3052 | num = parseInt(m.slice(3,-1), 16); 3053 | } else { 3054 | num = parseInt(m.slice(2,-1), 10); 3055 | } 3056 | uchar = fromCodePoint(num); 3057 | } else { 3058 | uchar = entities[m.slice(1,-1)]; 3059 | } 3060 | return (uchar || m); 3061 | }; 3062 | 3063 | module.exports.entityToChar = entityToChar; 3064 | 3065 | },{"./from-code-point":2}],5:[function(require,module,exports){ 3066 | // commonmark.js - CommomMark in JavaScript 3067 | // Copyright (C) 2014 John MacFarlane 3068 | // License: BSD3. 3069 | 3070 | // Basic usage: 3071 | // 3072 | // var commonmark = require('commonmark'); 3073 | // var parser = new commonmark.DocParser(); 3074 | // var renderer = new commonmark.HtmlRenderer(); 3075 | // console.log(renderer.render(parser.parse('Hello *world*'))); 3076 | 3077 | var util = require('util'); 3078 | 3079 | var renderAST = function(tree) { 3080 | return util.inspect(tree, {depth: null}); 3081 | } 3082 | 3083 | module.exports.DocParser = require('./blocks'); 3084 | module.exports.HtmlRenderer = require('./html-renderer'); 3085 | module.exports.ASTRenderer = renderAST; 3086 | 3087 | },{"./blocks":1,"./html-renderer":3,"util":10}],6:[function(require,module,exports){ 3088 | var fromCodePoint = require('./from-code-point.js'); 3089 | var entityToChar = require('./html5-entities.js').entityToChar; 3090 | 3091 | // Constants for character codes: 3092 | 3093 | var C_NEWLINE = 10; 3094 | var C_SPACE = 32; 3095 | var C_ASTERISK = 42; 3096 | var C_UNDERSCORE = 95; 3097 | var C_BACKTICK = 96; 3098 | var C_OPEN_BRACKET = 91; 3099 | var C_CLOSE_BRACKET = 93; 3100 | var C_LESSTHAN = 60; 3101 | var C_GREATERTHAN = 62; 3102 | var C_BANG = 33; 3103 | var C_BACKSLASH = 92; 3104 | var C_AMPERSAND = 38; 3105 | var C_OPEN_PAREN = 40; 3106 | var C_COLON = 58; 3107 | 3108 | // Some regexps used in inline parser: 3109 | 3110 | var ESCAPABLE = '[!"#$%&\'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]'; 3111 | var ESCAPED_CHAR = '\\\\' + ESCAPABLE; 3112 | var IN_DOUBLE_QUOTES = '"(' + ESCAPED_CHAR + '|[^"\\x00])*"'; 3113 | var IN_SINGLE_QUOTES = '\'(' + ESCAPED_CHAR + '|[^\'\\x00])*\''; 3114 | var IN_PARENS = '\\((' + ESCAPED_CHAR + '|[^)\\x00])*\\)'; 3115 | var REG_CHAR = '[^\\\\()\\x00-\\x20]'; 3116 | var IN_PARENS_NOSP = '\\((' + REG_CHAR + '|' + ESCAPED_CHAR + ')*\\)'; 3117 | var TAGNAME = '[A-Za-z][A-Za-z0-9]*'; 3118 | var ATTRIBUTENAME = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; 3119 | var UNQUOTEDVALUE = "[^\"'=<>`\\x00-\\x20]+"; 3120 | var SINGLEQUOTEDVALUE = "'[^']*'"; 3121 | var DOUBLEQUOTEDVALUE = '"[^"]*"'; 3122 | var ATTRIBUTEVALUE = "(?:" + UNQUOTEDVALUE + "|" + SINGLEQUOTEDVALUE + "|" + DOUBLEQUOTEDVALUE + ")"; 3123 | var ATTRIBUTEVALUESPEC = "(?:" + "\\s*=" + "\\s*" + ATTRIBUTEVALUE + ")"; 3124 | var ATTRIBUTE = "(?:" + "\\s+" + ATTRIBUTENAME + ATTRIBUTEVALUESPEC + "?)"; 3125 | var OPENTAG = "<" + TAGNAME + ATTRIBUTE + "*" + "\\s*/?>"; 3126 | var CLOSETAG = "]"; 3127 | var HTMLCOMMENT = ""; 3128 | var PROCESSINGINSTRUCTION = "[<][?].*?[?][>]"; 3129 | var DECLARATION = "]*>"; 3130 | var CDATA = "])*\\]\\]>"; 3131 | var HTMLTAG = "(?:" + OPENTAG + "|" + CLOSETAG + "|" + HTMLCOMMENT + "|" + 3132 | PROCESSINGINSTRUCTION + "|" + DECLARATION + "|" + CDATA + ")"; 3133 | var ENTITY = "&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});"; 3134 | 3135 | var reHtmlTag = new RegExp('^' + HTMLTAG, 'i'); 3136 | 3137 | var reLinkTitle = new RegExp( 3138 | '^(?:"(' + ESCAPED_CHAR + '|[^"\\x00])*"' + 3139 | '|' + 3140 | '\'(' + ESCAPED_CHAR + '|[^\'\\x00])*\'' + 3141 | '|' + 3142 | '\\((' + ESCAPED_CHAR + '|[^)\\x00])*\\))'); 3143 | 3144 | var reLinkDestinationBraces = new RegExp( 3145 | '^(?:[<](?:[^<>\\n\\\\\\x00]' + '|' + ESCAPED_CHAR + '|' + '\\\\)*[>])'); 3146 | 3147 | var reLinkDestination = new RegExp( 3148 | '^(?:' + REG_CHAR + '+|' + ESCAPED_CHAR + '|' + IN_PARENS_NOSP + ')*'); 3149 | 3150 | var reEscapable = new RegExp(ESCAPABLE); 3151 | 3152 | var reAllEscapedChar = new RegExp('\\\\(' + ESCAPABLE + ')', 'g'); 3153 | 3154 | var reEscapedChar = new RegExp('^\\\\(' + ESCAPABLE + ')'); 3155 | 3156 | var reEntityHere = new RegExp('^' + ENTITY, 'i'); 3157 | 3158 | var reEntity = new RegExp(ENTITY, 'gi'); 3159 | 3160 | // Matches a character with a special meaning in markdown, 3161 | // or a string of non-special characters. Note: we match 3162 | // clumps of _ or * or `, because they need to be handled in groups. 3163 | var reMain = /^(?:[_*`\n]+|[\[\]\\!<&*_]|(?: *[^\n `\[\]\\!<&*_]+)+|[ \n]+)/m; 3164 | 3165 | // Replace entities and backslash escapes with literal characters. 3166 | var unescapeString = function(s) { 3167 | return s.replace(reAllEscapedChar, '$1') 3168 | .replace(reEntity, entityToChar); 3169 | }; 3170 | 3171 | // Normalize reference label: collapse internal whitespace 3172 | // to single space, remove leading/trailing whitespace, case fold. 3173 | var normalizeReference = function(s) { 3174 | return s.trim() 3175 | .replace(/\s+/,' ') 3176 | .toUpperCase(); 3177 | }; 3178 | 3179 | // INLINE PARSER 3180 | 3181 | // These are methods of an InlineParser object, defined below. 3182 | // An InlineParser keeps track of a subject (a string to be 3183 | // parsed) and a position in that subject. 3184 | 3185 | // If re matches at current position in the subject, advance 3186 | // position in subject and return the match; otherwise return null. 3187 | var match = function(re) { 3188 | var match = re.exec(this.subject.slice(this.pos)); 3189 | if (match) { 3190 | this.pos += match.index + match[0].length; 3191 | return match[0]; 3192 | } else { 3193 | return null; 3194 | } 3195 | }; 3196 | 3197 | // Returns the code for the character at the current subject position, or -1 3198 | // there are no more characters. 3199 | var peek = function() { 3200 | if (this.pos < this.subject.length) { 3201 | return this.subject.charCodeAt(this.pos); 3202 | } else { 3203 | return -1; 3204 | } 3205 | }; 3206 | 3207 | // Parse zero or more space characters, including at most one newline 3208 | var spnl = function() { 3209 | this.match(/^ *(?:\n *)?/); 3210 | return 1; 3211 | }; 3212 | 3213 | // All of the parsers below try to match something at the current position 3214 | // in the subject. If they succeed in matching anything, they 3215 | // return the inline matched, advancing the subject. 3216 | 3217 | // Attempt to parse backticks, returning either a backtick code span or a 3218 | // literal sequence of backticks. 3219 | var parseBackticks = function(inlines) { 3220 | var startpos = this.pos; 3221 | var ticks = this.match(/^`+/); 3222 | if (!ticks) { 3223 | return 0; 3224 | } 3225 | var afterOpenTicks = this.pos; 3226 | var foundCode = false; 3227 | var match; 3228 | while (!foundCode && (match = this.match(/`+/m))) { 3229 | if (match == ticks) { 3230 | inlines.push({ t: 'Code', c: this.subject.slice(afterOpenTicks, 3231 | this.pos - ticks.length) 3232 | .replace(/[ \n]+/g,' ') 3233 | .trim() }); 3234 | return true; 3235 | } 3236 | } 3237 | // If we got here, we didn't match a closing backtick sequence. 3238 | this.pos = afterOpenTicks; 3239 | inlines.push({ t: 'Str', c: ticks }); 3240 | return true; 3241 | }; 3242 | 3243 | // Parse a backslash-escaped special character, adding either the escaped 3244 | // character, a hard line break (if the backslash is followed by a newline), 3245 | // or a literal backslash to the 'inlines' list. 3246 | var parseBackslash = function(inlines) { 3247 | var subj = this.subject, 3248 | pos = this.pos; 3249 | if (subj.charCodeAt(pos) === C_BACKSLASH) { 3250 | if (subj.charAt(pos + 1) === '\n') { 3251 | this.pos = this.pos + 2; 3252 | inlines.push({ t: 'Hardbreak' }); 3253 | } else if (reEscapable.test(subj.charAt(pos + 1))) { 3254 | this.pos = this.pos + 2; 3255 | inlines.push({ t: 'Str', c: subj.charAt(pos + 1) }); 3256 | } else { 3257 | this.pos++; 3258 | inlines.push({t: 'Str', c: '\\'}); 3259 | } 3260 | return true; 3261 | } else { 3262 | return false; 3263 | } 3264 | }; 3265 | 3266 | // Attempt to parse an autolink (URL or email in pointy brackets). 3267 | var parseAutolink = function(inlines) { 3268 | var m; 3269 | var dest; 3270 | if ((m = this.match(/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/))) { // email autolink 3271 | dest = m.slice(1,-1); 3272 | inlines.push( 3273 | {t: 'Link', 3274 | label: [{ t: 'Str', c: dest }], 3275 | destination: 'mailto:' + encodeURI(unescape(dest)) }); 3276 | return true; 3277 | } else if ((m = this.match(/^<(?:coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr):[^<>\x00-\x20]*>/i))) { 3278 | dest = m.slice(1,-1); 3279 | inlines.push({ 3280 | t: 'Link', 3281 | label: [{ t: 'Str', c: dest }], 3282 | destination: encodeURI(unescape(dest)) }); 3283 | return true; 3284 | } else { 3285 | return false; 3286 | } 3287 | }; 3288 | 3289 | // Attempt to parse a raw HTML tag. 3290 | var parseHtmlTag = function(inlines) { 3291 | var m = this.match(reHtmlTag); 3292 | if (m) { 3293 | inlines.push({ t: 'Html', c: m }); 3294 | return true; 3295 | } else { 3296 | return false; 3297 | } 3298 | }; 3299 | 3300 | // Scan a sequence of characters with code cc, and return information about 3301 | // the number of delimiters and whether they are positioned such that 3302 | // they can open and/or close emphasis or strong emphasis. A utility 3303 | // function for strong/emph parsing. 3304 | var scanDelims = function(cc) { 3305 | var numdelims = 0; 3306 | var first_close_delims = 0; 3307 | var char_before, char_after, cc_after; 3308 | var startpos = this.pos; 3309 | 3310 | char_before = this.pos === 0 ? '\n' : 3311 | this.subject.charAt(this.pos - 1); 3312 | 3313 | while (this.peek() === cc) { 3314 | numdelims++; 3315 | this.pos++; 3316 | } 3317 | 3318 | cc_after = this.peek(); 3319 | if (cc_after === -1) { 3320 | char_after = '\n'; 3321 | } else { 3322 | char_after = fromCodePoint(cc_after); 3323 | } 3324 | 3325 | var can_open = numdelims > 0 && numdelims <= 3 && !(/\s/.test(char_after)); 3326 | var can_close = numdelims > 0 && numdelims <= 3 && !(/\s/.test(char_before)); 3327 | if (cc === C_UNDERSCORE) { 3328 | can_open = can_open && !((/[a-z0-9]/i).test(char_before)); 3329 | can_close = can_close && !((/[a-z0-9]/i).test(char_after)); 3330 | } 3331 | this.pos = startpos; 3332 | return { numdelims: numdelims, 3333 | can_open: can_open, 3334 | can_close: can_close }; 3335 | }; 3336 | 3337 | var Emph = function(ils) { 3338 | return {t: 'Emph', c: ils}; 3339 | }; 3340 | 3341 | var Strong = function(ils) { 3342 | return {t: 'Strong', c: ils}; 3343 | }; 3344 | 3345 | var Str = function(s) { 3346 | return {t: 'Str', c: s}; 3347 | }; 3348 | 3349 | // Attempt to parse emphasis or strong emphasis. 3350 | var parseEmphasis = function(cc,inlines) { 3351 | var startpos = this.pos; 3352 | 3353 | var res = this.scanDelims(cc); 3354 | var numdelims = res.numdelims; 3355 | 3356 | if (numdelims === 0) { 3357 | this.pos = startpos; 3358 | return false; 3359 | } 3360 | 3361 | if (res.can_close) { 3362 | 3363 | // Walk the stack and find a matching opener, if possible 3364 | var opener = this.emphasis_openers; 3365 | while (opener) { 3366 | 3367 | if (opener.cc === cc) { // we have a match! 3368 | 3369 | if (opener.numdelims <= numdelims) { // all openers used 3370 | 3371 | this.pos += opener.numdelims; 3372 | var X; 3373 | switch (opener.numdelims) { 3374 | case 3: 3375 | X = function(x) { return Strong([Emph(x)]); }; 3376 | break; 3377 | case 2: 3378 | X = Strong; 3379 | break; 3380 | case 1: 3381 | default: 3382 | X = Emph; 3383 | break; 3384 | } 3385 | inlines[opener.pos] = X(inlines.slice(opener.pos + 1)); 3386 | inlines.splice(opener.pos + 1, inlines.length - (opener.pos + 1)); 3387 | // Remove entries after this, to prevent overlapping nesting: 3388 | this.emphasis_openers = opener.previous; 3389 | return true; 3390 | 3391 | } else if (opener.numdelims > numdelims) { // only some openers used 3392 | 3393 | this.pos += numdelims; 3394 | opener.numdelims -= numdelims; 3395 | inlines[opener.pos].c = 3396 | inlines[opener.pos].c.slice(0, opener.numdelims); 3397 | var X = numdelims === 2 ? Strong : Emph; 3398 | inlines[opener.pos + 1] = X(inlines.slice(opener.pos + 1)); 3399 | inlines.splice(opener.pos + 2, inlines.length - (opener.pos + 2)); 3400 | // Remove entries after this, to prevent overlapping nesting: 3401 | this.emphasis_openers = opener; 3402 | return true; 3403 | 3404 | } 3405 | 3406 | } 3407 | opener = opener.previous; 3408 | } 3409 | } 3410 | 3411 | // If we're here, we didn't match a closer. 3412 | 3413 | this.pos += numdelims; 3414 | inlines.push(Str(this.subject.slice(startpos, startpos + numdelims))); 3415 | 3416 | if (res.can_open) { 3417 | 3418 | // Add entry to stack for this opener 3419 | this.emphasis_openers = { cc: cc, 3420 | numdelims: numdelims, 3421 | pos: inlines.length - 1, 3422 | previous: this.emphasis_openers }; 3423 | } 3424 | 3425 | return true; 3426 | 3427 | }; 3428 | 3429 | // Attempt to parse link title (sans quotes), returning the string 3430 | // or null if no match. 3431 | var parseLinkTitle = function() { 3432 | var title = this.match(reLinkTitle); 3433 | if (title) { 3434 | // chop off quotes from title and unescape: 3435 | return unescapeString(title.substr(1, title.length - 2)); 3436 | } else { 3437 | return null; 3438 | } 3439 | }; 3440 | 3441 | // Attempt to parse link destination, returning the string or 3442 | // null if no match. 3443 | var parseLinkDestination = function() { 3444 | var res = this.match(reLinkDestinationBraces); 3445 | if (res) { // chop off surrounding <..>: 3446 | return encodeURI(unescape(unescapeString(res.substr(1, res.length - 2)))); 3447 | } else { 3448 | res = this.match(reLinkDestination); 3449 | if (res !== null) { 3450 | return encodeURI(unescape(unescapeString(res))); 3451 | } else { 3452 | return null; 3453 | } 3454 | } 3455 | }; 3456 | 3457 | // Attempt to parse a link label, returning number of characters parsed. 3458 | var parseLinkLabel = function() { 3459 | if (this.peek() != C_OPEN_BRACKET) { 3460 | return 0; 3461 | } 3462 | var startpos = this.pos; 3463 | var nest_level = 0; 3464 | if (this.label_nest_level > 0) { 3465 | // If we've already checked to the end of this subject 3466 | // for a label, even with a different starting [, we 3467 | // know we won't find one here and we can just return. 3468 | // This avoids lots of backtracking. 3469 | // Note: nest level 1 would be: [foo [bar] 3470 | // nest level 2 would be: [foo [bar [baz] 3471 | this.label_nest_level--; 3472 | return 0; 3473 | } 3474 | this.pos++; // advance past [ 3475 | var c; 3476 | while ((c = this.peek()) && c != -1 && (c != C_CLOSE_BRACKET || nest_level > 0)) { 3477 | switch (c) { 3478 | case C_BACKTICK: 3479 | this.parseBackticks([]); 3480 | break; 3481 | case C_LESSTHAN: 3482 | if (!(this.parseAutolink([]) || this.parseHtmlTag([]))) { 3483 | this.pos++; 3484 | } 3485 | break; 3486 | case C_OPEN_BRACKET: // nested [] 3487 | nest_level++; 3488 | this.pos++; 3489 | break; 3490 | case C_CLOSE_BRACKET: // nested [] 3491 | nest_level--; 3492 | this.pos++; 3493 | break; 3494 | case C_BACKSLASH: 3495 | this.parseBackslash([]); 3496 | break; 3497 | default: 3498 | this.parseString([]); 3499 | } 3500 | } 3501 | if (c === C_CLOSE_BRACKET) { 3502 | this.label_nest_level = 0; 3503 | this.pos++; // advance past ] 3504 | return this.pos - startpos; 3505 | } else { 3506 | if (c === -1) { 3507 | this.label_nest_level = nest_level; 3508 | } 3509 | this.pos = startpos; 3510 | return 0; 3511 | } 3512 | }; 3513 | 3514 | // Parse raw link label, including surrounding [], and return 3515 | // inline contents. (Note: this is not a method of InlineParser.) 3516 | var parseRawLabel = function(s) { 3517 | // note: parse without a refmap; we don't want links to resolve 3518 | // in nested brackets! 3519 | return new InlineParser().parse(s.substr(1, s.length - 2), {}); 3520 | }; 3521 | 3522 | // Attempt to parse a link. If successful, return the link. 3523 | var parseLink = function(inlines) { 3524 | var startpos = this.pos; 3525 | var reflabel; 3526 | var n; 3527 | var dest; 3528 | var title; 3529 | 3530 | n = this.parseLinkLabel(); 3531 | if (n === 0) { 3532 | return false; 3533 | } 3534 | var afterlabel = this.pos; 3535 | var rawlabel = this.subject.substr(startpos, n); 3536 | 3537 | // if we got this far, we've parsed a label. 3538 | // Try to parse an explicit link: [label](url "title") 3539 | if (this.peek() == C_OPEN_PAREN) { 3540 | this.pos++; 3541 | if (this.spnl() && 3542 | ((dest = this.parseLinkDestination()) !== null) && 3543 | this.spnl() && 3544 | // make sure there's a space before the title: 3545 | (/^\s/.test(this.subject.charAt(this.pos - 1)) && 3546 | (title = this.parseLinkTitle() || '') || true) && 3547 | this.spnl() && 3548 | this.match(/^\)/)) { 3549 | inlines.push({ t: 'Link', 3550 | destination: dest, 3551 | title: title, 3552 | label: parseRawLabel(rawlabel) }); 3553 | return true; 3554 | } else { 3555 | this.pos = startpos; 3556 | return false; 3557 | } 3558 | } 3559 | // If we're here, it wasn't an explicit link. Try to parse a reference link. 3560 | // first, see if there's another label 3561 | var savepos = this.pos; 3562 | this.spnl(); 3563 | var beforelabel = this.pos; 3564 | n = this.parseLinkLabel(); 3565 | if (n == 2) { 3566 | // empty second label 3567 | reflabel = rawlabel; 3568 | } else if (n > 0) { 3569 | reflabel = this.subject.slice(beforelabel, beforelabel + n); 3570 | } else { 3571 | this.pos = savepos; 3572 | reflabel = rawlabel; 3573 | } 3574 | // lookup rawlabel in refmap 3575 | var link = this.refmap[normalizeReference(reflabel)]; 3576 | if (link) { 3577 | inlines.push({t: 'Link', 3578 | destination: link.destination, 3579 | title: link.title, 3580 | label: parseRawLabel(rawlabel) }); 3581 | return true; 3582 | } else { 3583 | this.pos = startpos; 3584 | return false; 3585 | } 3586 | // Nothing worked, rewind: 3587 | this.pos = startpos; 3588 | return false; 3589 | }; 3590 | 3591 | // Attempt to parse an entity, return Entity object if successful. 3592 | var parseEntity = function(inlines) { 3593 | var m; 3594 | if ((m = this.match(reEntityHere))) { 3595 | inlines.push({ t: 'Str', c: entityToChar(m) }); 3596 | return true; 3597 | } else { 3598 | return false; 3599 | } 3600 | }; 3601 | 3602 | // Parse a run of ordinary characters, or a single character with 3603 | // a special meaning in markdown, as a plain string, adding to inlines. 3604 | var parseString = function(inlines) { 3605 | var m; 3606 | if ((m = this.match(reMain))) { 3607 | inlines.push({ t: 'Str', c: m }); 3608 | return true; 3609 | } else { 3610 | return false; 3611 | } 3612 | }; 3613 | 3614 | // Parse a newline. If it was preceded by two spaces, return a hard 3615 | // line break; otherwise a soft line break. 3616 | var parseNewline = function(inlines) { 3617 | var m = this.match(/^ *\n/); 3618 | if (m) { 3619 | if (m.length > 2) { 3620 | inlines.push({ t: 'Hardbreak' }); 3621 | } else if (m.length > 0) { 3622 | inlines.push({ t: 'Softbreak' }); 3623 | } 3624 | return true; 3625 | } 3626 | return false; 3627 | }; 3628 | 3629 | // Attempt to parse an image. If the opening '!' is not followed 3630 | // by a link, return a literal '!'. 3631 | var parseImage = function(inlines) { 3632 | if (this.match(/^!/)) { 3633 | var link = this.parseLink(inlines); 3634 | if (link) { 3635 | inlines[inlines.length - 1].t = 'Image'; 3636 | return true; 3637 | } else { 3638 | inlines.push({ t: 'Str', c: '!' }); 3639 | return true; 3640 | } 3641 | } else { 3642 | return false; 3643 | } 3644 | }; 3645 | 3646 | // Attempt to parse a link reference, modifying refmap. 3647 | var parseReference = function(s, refmap) { 3648 | this.subject = s; 3649 | this.pos = 0; 3650 | this.label_nest_level = 0; 3651 | var rawlabel; 3652 | var dest; 3653 | var title; 3654 | var matchChars; 3655 | var startpos = this.pos; 3656 | var match; 3657 | 3658 | // label: 3659 | matchChars = this.parseLinkLabel(); 3660 | if (matchChars === 0) { 3661 | return 0; 3662 | } else { 3663 | rawlabel = this.subject.substr(0, matchChars); 3664 | } 3665 | 3666 | // colon: 3667 | if (this.peek() === C_COLON) { 3668 | this.pos++; 3669 | } else { 3670 | this.pos = startpos; 3671 | return 0; 3672 | } 3673 | 3674 | // link url 3675 | this.spnl(); 3676 | 3677 | dest = this.parseLinkDestination(); 3678 | if (dest === null || dest.length === 0) { 3679 | this.pos = startpos; 3680 | return 0; 3681 | } 3682 | 3683 | var beforetitle = this.pos; 3684 | this.spnl(); 3685 | title = this.parseLinkTitle(); 3686 | if (title === null) { 3687 | title = ''; 3688 | // rewind before spaces 3689 | this.pos = beforetitle; 3690 | } 3691 | 3692 | // make sure we're at line end: 3693 | if (this.match(/^ *(?:\n|$)/) === null) { 3694 | this.pos = startpos; 3695 | return 0; 3696 | } 3697 | 3698 | var normlabel = normalizeReference(rawlabel); 3699 | 3700 | if (!refmap[normlabel]) { 3701 | refmap[normlabel] = { destination: dest, title: title }; 3702 | } 3703 | return this.pos - startpos; 3704 | }; 3705 | 3706 | // Parse the next inline element in subject, advancing subject position. 3707 | // On success, add the result to the inlines list, and return true. 3708 | // On failure, return false. 3709 | var parseInline = function(inlines) { 3710 | var startpos = this.pos; 3711 | var origlen = inlines.length; 3712 | 3713 | var c = this.peek(); 3714 | if (c === -1) { 3715 | return false; 3716 | } 3717 | var res; 3718 | switch(c) { 3719 | case C_NEWLINE: 3720 | case C_SPACE: 3721 | res = this.parseNewline(inlines); 3722 | break; 3723 | case C_BACKSLASH: 3724 | res = this.parseBackslash(inlines); 3725 | break; 3726 | case C_BACKTICK: 3727 | res = this.parseBackticks(inlines); 3728 | break; 3729 | case C_ASTERISK: 3730 | case C_UNDERSCORE: 3731 | res = this.parseEmphasis(c, inlines); 3732 | break; 3733 | case C_OPEN_BRACKET: 3734 | res = this.parseLink(inlines); 3735 | break; 3736 | case C_BANG: 3737 | res = this.parseImage(inlines); 3738 | break; 3739 | case C_LESSTHAN: 3740 | res = this.parseAutolink(inlines) || this.parseHtmlTag(inlines); 3741 | break; 3742 | case C_AMPERSAND: 3743 | res = this.parseEntity(inlines); 3744 | break; 3745 | default: 3746 | res = this.parseString(inlines); 3747 | break; 3748 | } 3749 | if (!res) { 3750 | this.pos += 1; 3751 | inlines.push({t: 'Str', c: fromCodePoint(c)}); 3752 | } 3753 | 3754 | return true; 3755 | }; 3756 | 3757 | // Parse s as a list of inlines, using refmap to resolve references. 3758 | var parseInlines = function(s, refmap) { 3759 | this.subject = s; 3760 | this.pos = 0; 3761 | this.refmap = refmap || {}; 3762 | this.emphasis_openers = null; 3763 | var inlines = []; 3764 | while (this.parseInline(inlines)) { 3765 | } 3766 | return inlines; 3767 | }; 3768 | 3769 | // The InlineParser object. 3770 | function InlineParser(){ 3771 | return { 3772 | subject: '', 3773 | label_nest_level: 0, // used by parseLinkLabel method 3774 | emphasis_openers: null, // used by parseEmphasis method 3775 | pos: 0, 3776 | refmap: {}, 3777 | match: match, 3778 | peek: peek, 3779 | spnl: spnl, 3780 | unescapeString: unescapeString, 3781 | parseBackticks: parseBackticks, 3782 | parseBackslash: parseBackslash, 3783 | parseAutolink: parseAutolink, 3784 | parseHtmlTag: parseHtmlTag, 3785 | scanDelims: scanDelims, 3786 | parseEmphasis: parseEmphasis, 3787 | parseLinkTitle: parseLinkTitle, 3788 | parseLinkDestination: parseLinkDestination, 3789 | parseLinkLabel: parseLinkLabel, 3790 | parseLink: parseLink, 3791 | parseEntity: parseEntity, 3792 | parseString: parseString, 3793 | parseNewline: parseNewline, 3794 | parseImage: parseImage, 3795 | parseReference: parseReference, 3796 | parseInline: parseInline, 3797 | parse: parseInlines 3798 | }; 3799 | } 3800 | 3801 | module.exports = InlineParser; 3802 | 3803 | },{"./from-code-point.js":2,"./html5-entities.js":4}],7:[function(require,module,exports){ 3804 | if (typeof Object.create === 'function') { 3805 | // implementation from standard node.js 'util' module 3806 | module.exports = function inherits(ctor, superCtor) { 3807 | ctor.super_ = superCtor 3808 | ctor.prototype = Object.create(superCtor.prototype, { 3809 | constructor: { 3810 | value: ctor, 3811 | enumerable: false, 3812 | writable: true, 3813 | configurable: true 3814 | } 3815 | }); 3816 | }; 3817 | } else { 3818 | // old school shim for old browsers 3819 | module.exports = function inherits(ctor, superCtor) { 3820 | ctor.super_ = superCtor 3821 | var TempCtor = function () {} 3822 | TempCtor.prototype = superCtor.prototype 3823 | ctor.prototype = new TempCtor() 3824 | ctor.prototype.constructor = ctor 3825 | } 3826 | } 3827 | 3828 | },{}],8:[function(require,module,exports){ 3829 | // shim for using process in browser 3830 | 3831 | var process = module.exports = {}; 3832 | 3833 | process.nextTick = (function () { 3834 | var canSetImmediate = typeof window !== 'undefined' 3835 | && window.setImmediate; 3836 | var canMutationObserver = typeof window !== 'undefined' 3837 | && window.MutationObserver; 3838 | var canPost = typeof window !== 'undefined' 3839 | && window.postMessage && window.addEventListener 3840 | ; 3841 | 3842 | if (canSetImmediate) { 3843 | return function (f) { return window.setImmediate(f) }; 3844 | } 3845 | 3846 | var queue = []; 3847 | 3848 | if (canMutationObserver) { 3849 | var hiddenDiv = document.createElement("div"); 3850 | var observer = new MutationObserver(function () { 3851 | var queueList = queue.slice(); 3852 | queue.length = 0; 3853 | queueList.forEach(function (fn) { 3854 | fn(); 3855 | }); 3856 | }); 3857 | 3858 | observer.observe(hiddenDiv, { attributes: true }); 3859 | 3860 | return function nextTick(fn) { 3861 | if (!queue.length) { 3862 | hiddenDiv.setAttribute('yes', 'no'); 3863 | } 3864 | queue.push(fn); 3865 | }; 3866 | } 3867 | 3868 | if (canPost) { 3869 | window.addEventListener('message', function (ev) { 3870 | var source = ev.source; 3871 | if ((source === window || source === null) && ev.data === 'process-tick') { 3872 | ev.stopPropagation(); 3873 | if (queue.length > 0) { 3874 | var fn = queue.shift(); 3875 | fn(); 3876 | } 3877 | } 3878 | }, true); 3879 | 3880 | return function nextTick(fn) { 3881 | queue.push(fn); 3882 | window.postMessage('process-tick', '*'); 3883 | }; 3884 | } 3885 | 3886 | return function nextTick(fn) { 3887 | setTimeout(fn, 0); 3888 | }; 3889 | })(); 3890 | 3891 | process.title = 'browser'; 3892 | process.browser = true; 3893 | process.env = {}; 3894 | process.argv = []; 3895 | 3896 | function noop() {} 3897 | 3898 | process.on = noop; 3899 | process.addListener = noop; 3900 | process.once = noop; 3901 | process.off = noop; 3902 | process.removeListener = noop; 3903 | process.removeAllListeners = noop; 3904 | process.emit = noop; 3905 | 3906 | process.binding = function (name) { 3907 | throw new Error('process.binding is not supported'); 3908 | }; 3909 | 3910 | // TODO(shtylman) 3911 | process.cwd = function () { return '/' }; 3912 | process.chdir = function (dir) { 3913 | throw new Error('process.chdir is not supported'); 3914 | }; 3915 | 3916 | },{}],9:[function(require,module,exports){ 3917 | module.exports = function isBuffer(arg) { 3918 | return arg && typeof arg === 'object' 3919 | && typeof arg.copy === 'function' 3920 | && typeof arg.fill === 'function' 3921 | && typeof arg.readUInt8 === 'function'; 3922 | } 3923 | },{}],10:[function(require,module,exports){ 3924 | (function (process,global){ 3925 | // Copyright Joyent, Inc. and other Node contributors. 3926 | // 3927 | // Permission is hereby granted, free of charge, to any person obtaining a 3928 | // copy of this software and associated documentation files (the 3929 | // "Software"), to deal in the Software without restriction, including 3930 | // without limitation the rights to use, copy, modify, merge, publish, 3931 | // distribute, sublicense, and/or sell copies of the Software, and to permit 3932 | // persons to whom the Software is furnished to do so, subject to the 3933 | // following conditions: 3934 | // 3935 | // The above copyright notice and this permission notice shall be included 3936 | // in all copies or substantial portions of the Software. 3937 | // 3938 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 3939 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 3940 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 3941 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 3942 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 3943 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 3944 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 3945 | 3946 | var formatRegExp = /%[sdj%]/g; 3947 | exports.format = function(f) { 3948 | if (!isString(f)) { 3949 | var objects = []; 3950 | for (var i = 0; i < arguments.length; i++) { 3951 | objects.push(inspect(arguments[i])); 3952 | } 3953 | return objects.join(' '); 3954 | } 3955 | 3956 | var i = 1; 3957 | var args = arguments; 3958 | var len = args.length; 3959 | var str = String(f).replace(formatRegExp, function(x) { 3960 | if (x === '%%') return '%'; 3961 | if (i >= len) return x; 3962 | switch (x) { 3963 | case '%s': return String(args[i++]); 3964 | case '%d': return Number(args[i++]); 3965 | case '%j': 3966 | try { 3967 | return JSON.stringify(args[i++]); 3968 | } catch (_) { 3969 | return '[Circular]'; 3970 | } 3971 | default: 3972 | return x; 3973 | } 3974 | }); 3975 | for (var x = args[i]; i < len; x = args[++i]) { 3976 | if (isNull(x) || !isObject(x)) { 3977 | str += ' ' + x; 3978 | } else { 3979 | str += ' ' + inspect(x); 3980 | } 3981 | } 3982 | return str; 3983 | }; 3984 | 3985 | 3986 | // Mark that a method should not be used. 3987 | // Returns a modified function which warns once by default. 3988 | // If --no-deprecation is set, then it is a no-op. 3989 | exports.deprecate = function(fn, msg) { 3990 | // Allow for deprecating things in the process of starting up. 3991 | if (isUndefined(global.process)) { 3992 | return function() { 3993 | return exports.deprecate(fn, msg).apply(this, arguments); 3994 | }; 3995 | } 3996 | 3997 | if (process.noDeprecation === true) { 3998 | return fn; 3999 | } 4000 | 4001 | var warned = false; 4002 | function deprecated() { 4003 | if (!warned) { 4004 | if (process.throwDeprecation) { 4005 | throw new Error(msg); 4006 | } else if (process.traceDeprecation) { 4007 | console.trace(msg); 4008 | } else { 4009 | console.error(msg); 4010 | } 4011 | warned = true; 4012 | } 4013 | return fn.apply(this, arguments); 4014 | } 4015 | 4016 | return deprecated; 4017 | }; 4018 | 4019 | 4020 | var debugs = {}; 4021 | var debugEnviron; 4022 | exports.debuglog = function(set) { 4023 | if (isUndefined(debugEnviron)) 4024 | debugEnviron = process.env.NODE_DEBUG || ''; 4025 | set = set.toUpperCase(); 4026 | if (!debugs[set]) { 4027 | if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { 4028 | var pid = process.pid; 4029 | debugs[set] = function() { 4030 | var msg = exports.format.apply(exports, arguments); 4031 | console.error('%s %d: %s', set, pid, msg); 4032 | }; 4033 | } else { 4034 | debugs[set] = function() {}; 4035 | } 4036 | } 4037 | return debugs[set]; 4038 | }; 4039 | 4040 | 4041 | /** 4042 | * Echos the value of a value. Trys to print the value out 4043 | * in the best way possible given the different types. 4044 | * 4045 | * @param {Object} obj The object to print out. 4046 | * @param {Object} opts Optional options object that alters the output. 4047 | */ 4048 | /* legacy: obj, showHidden, depth, colors*/ 4049 | function inspect(obj, opts) { 4050 | // default options 4051 | var ctx = { 4052 | seen: [], 4053 | stylize: stylizeNoColor 4054 | }; 4055 | // legacy... 4056 | if (arguments.length >= 3) ctx.depth = arguments[2]; 4057 | if (arguments.length >= 4) ctx.colors = arguments[3]; 4058 | if (isBoolean(opts)) { 4059 | // legacy... 4060 | ctx.showHidden = opts; 4061 | } else if (opts) { 4062 | // got an "options" object 4063 | exports._extend(ctx, opts); 4064 | } 4065 | // set default options 4066 | if (isUndefined(ctx.showHidden)) ctx.showHidden = false; 4067 | if (isUndefined(ctx.depth)) ctx.depth = 2; 4068 | if (isUndefined(ctx.colors)) ctx.colors = false; 4069 | if (isUndefined(ctx.customInspect)) ctx.customInspect = true; 4070 | if (ctx.colors) ctx.stylize = stylizeWithColor; 4071 | return formatValue(ctx, obj, ctx.depth); 4072 | } 4073 | exports.inspect = inspect; 4074 | 4075 | 4076 | // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics 4077 | inspect.colors = { 4078 | 'bold' : [1, 22], 4079 | 'italic' : [3, 23], 4080 | 'underline' : [4, 24], 4081 | 'inverse' : [7, 27], 4082 | 'white' : [37, 39], 4083 | 'grey' : [90, 39], 4084 | 'black' : [30, 39], 4085 | 'blue' : [34, 39], 4086 | 'cyan' : [36, 39], 4087 | 'green' : [32, 39], 4088 | 'magenta' : [35, 39], 4089 | 'red' : [31, 39], 4090 | 'yellow' : [33, 39] 4091 | }; 4092 | 4093 | // Don't use 'blue' not visible on cmd.exe 4094 | inspect.styles = { 4095 | 'special': 'cyan', 4096 | 'number': 'yellow', 4097 | 'boolean': 'yellow', 4098 | 'undefined': 'grey', 4099 | 'null': 'bold', 4100 | 'string': 'green', 4101 | 'date': 'magenta', 4102 | // "name": intentionally not styling 4103 | 'regexp': 'red' 4104 | }; 4105 | 4106 | 4107 | function stylizeWithColor(str, styleType) { 4108 | var style = inspect.styles[styleType]; 4109 | 4110 | if (style) { 4111 | return '\u001b[' + inspect.colors[style][0] + 'm' + str + 4112 | '\u001b[' + inspect.colors[style][1] + 'm'; 4113 | } else { 4114 | return str; 4115 | } 4116 | } 4117 | 4118 | 4119 | function stylizeNoColor(str, styleType) { 4120 | return str; 4121 | } 4122 | 4123 | 4124 | function arrayToHash(array) { 4125 | var hash = {}; 4126 | 4127 | array.forEach(function(val, idx) { 4128 | hash[val] = true; 4129 | }); 4130 | 4131 | return hash; 4132 | } 4133 | 4134 | 4135 | function formatValue(ctx, value, recurseTimes) { 4136 | // Provide a hook for user-specified inspect functions. 4137 | // Check that value is an object with an inspect function on it 4138 | if (ctx.customInspect && 4139 | value && 4140 | isFunction(value.inspect) && 4141 | // Filter out the util module, it's inspect function is special 4142 | value.inspect !== exports.inspect && 4143 | // Also filter out any prototype objects using the circular check. 4144 | !(value.constructor && value.constructor.prototype === value)) { 4145 | var ret = value.inspect(recurseTimes, ctx); 4146 | if (!isString(ret)) { 4147 | ret = formatValue(ctx, ret, recurseTimes); 4148 | } 4149 | return ret; 4150 | } 4151 | 4152 | // Primitive types cannot have properties 4153 | var primitive = formatPrimitive(ctx, value); 4154 | if (primitive) { 4155 | return primitive; 4156 | } 4157 | 4158 | // Look up the keys of the object. 4159 | var keys = Object.keys(value); 4160 | var visibleKeys = arrayToHash(keys); 4161 | 4162 | if (ctx.showHidden) { 4163 | keys = Object.getOwnPropertyNames(value); 4164 | } 4165 | 4166 | // IE doesn't make error fields non-enumerable 4167 | // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx 4168 | if (isError(value) 4169 | && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { 4170 | return formatError(value); 4171 | } 4172 | 4173 | // Some type of object without properties can be shortcutted. 4174 | if (keys.length === 0) { 4175 | if (isFunction(value)) { 4176 | var name = value.name ? ': ' + value.name : ''; 4177 | return ctx.stylize('[Function' + name + ']', 'special'); 4178 | } 4179 | if (isRegExp(value)) { 4180 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 4181 | } 4182 | if (isDate(value)) { 4183 | return ctx.stylize(Date.prototype.toString.call(value), 'date'); 4184 | } 4185 | if (isError(value)) { 4186 | return formatError(value); 4187 | } 4188 | } 4189 | 4190 | var base = '', array = false, braces = ['{', '}']; 4191 | 4192 | // Make Array say that they are Array 4193 | if (isArray(value)) { 4194 | array = true; 4195 | braces = ['[', ']']; 4196 | } 4197 | 4198 | // Make functions say that they are functions 4199 | if (isFunction(value)) { 4200 | var n = value.name ? ': ' + value.name : ''; 4201 | base = ' [Function' + n + ']'; 4202 | } 4203 | 4204 | // Make RegExps say that they are RegExps 4205 | if (isRegExp(value)) { 4206 | base = ' ' + RegExp.prototype.toString.call(value); 4207 | } 4208 | 4209 | // Make dates with properties first say the date 4210 | if (isDate(value)) { 4211 | base = ' ' + Date.prototype.toUTCString.call(value); 4212 | } 4213 | 4214 | // Make error with message first say the error 4215 | if (isError(value)) { 4216 | base = ' ' + formatError(value); 4217 | } 4218 | 4219 | if (keys.length === 0 && (!array || value.length == 0)) { 4220 | return braces[0] + base + braces[1]; 4221 | } 4222 | 4223 | if (recurseTimes < 0) { 4224 | if (isRegExp(value)) { 4225 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 4226 | } else { 4227 | return ctx.stylize('[Object]', 'special'); 4228 | } 4229 | } 4230 | 4231 | ctx.seen.push(value); 4232 | 4233 | var output; 4234 | if (array) { 4235 | output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); 4236 | } else { 4237 | output = keys.map(function(key) { 4238 | return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); 4239 | }); 4240 | } 4241 | 4242 | ctx.seen.pop(); 4243 | 4244 | return reduceToSingleString(output, base, braces); 4245 | } 4246 | 4247 | 4248 | function formatPrimitive(ctx, value) { 4249 | if (isUndefined(value)) 4250 | return ctx.stylize('undefined', 'undefined'); 4251 | if (isString(value)) { 4252 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') 4253 | .replace(/'/g, "\\'") 4254 | .replace(/\\"/g, '"') + '\''; 4255 | return ctx.stylize(simple, 'string'); 4256 | } 4257 | if (isNumber(value)) 4258 | return ctx.stylize('' + value, 'number'); 4259 | if (isBoolean(value)) 4260 | return ctx.stylize('' + value, 'boolean'); 4261 | // For some reason typeof null is "object", so special case here. 4262 | if (isNull(value)) 4263 | return ctx.stylize('null', 'null'); 4264 | } 4265 | 4266 | 4267 | function formatError(value) { 4268 | return '[' + Error.prototype.toString.call(value) + ']'; 4269 | } 4270 | 4271 | 4272 | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { 4273 | var output = []; 4274 | for (var i = 0, l = value.length; i < l; ++i) { 4275 | if (hasOwnProperty(value, String(i))) { 4276 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, 4277 | String(i), true)); 4278 | } else { 4279 | output.push(''); 4280 | } 4281 | } 4282 | keys.forEach(function(key) { 4283 | if (!key.match(/^\d+$/)) { 4284 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, 4285 | key, true)); 4286 | } 4287 | }); 4288 | return output; 4289 | } 4290 | 4291 | 4292 | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { 4293 | var name, str, desc; 4294 | desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; 4295 | if (desc.get) { 4296 | if (desc.set) { 4297 | str = ctx.stylize('[Getter/Setter]', 'special'); 4298 | } else { 4299 | str = ctx.stylize('[Getter]', 'special'); 4300 | } 4301 | } else { 4302 | if (desc.set) { 4303 | str = ctx.stylize('[Setter]', 'special'); 4304 | } 4305 | } 4306 | if (!hasOwnProperty(visibleKeys, key)) { 4307 | name = '[' + key + ']'; 4308 | } 4309 | if (!str) { 4310 | if (ctx.seen.indexOf(desc.value) < 0) { 4311 | if (isNull(recurseTimes)) { 4312 | str = formatValue(ctx, desc.value, null); 4313 | } else { 4314 | str = formatValue(ctx, desc.value, recurseTimes - 1); 4315 | } 4316 | if (str.indexOf('\n') > -1) { 4317 | if (array) { 4318 | str = str.split('\n').map(function(line) { 4319 | return ' ' + line; 4320 | }).join('\n').substr(2); 4321 | } else { 4322 | str = '\n' + str.split('\n').map(function(line) { 4323 | return ' ' + line; 4324 | }).join('\n'); 4325 | } 4326 | } 4327 | } else { 4328 | str = ctx.stylize('[Circular]', 'special'); 4329 | } 4330 | } 4331 | if (isUndefined(name)) { 4332 | if (array && key.match(/^\d+$/)) { 4333 | return str; 4334 | } 4335 | name = JSON.stringify('' + key); 4336 | if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { 4337 | name = name.substr(1, name.length - 2); 4338 | name = ctx.stylize(name, 'name'); 4339 | } else { 4340 | name = name.replace(/'/g, "\\'") 4341 | .replace(/\\"/g, '"') 4342 | .replace(/(^"|"$)/g, "'"); 4343 | name = ctx.stylize(name, 'string'); 4344 | } 4345 | } 4346 | 4347 | return name + ': ' + str; 4348 | } 4349 | 4350 | 4351 | function reduceToSingleString(output, base, braces) { 4352 | var numLinesEst = 0; 4353 | var length = output.reduce(function(prev, cur) { 4354 | numLinesEst++; 4355 | if (cur.indexOf('\n') >= 0) numLinesEst++; 4356 | return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; 4357 | }, 0); 4358 | 4359 | if (length > 60) { 4360 | return braces[0] + 4361 | (base === '' ? '' : base + '\n ') + 4362 | ' ' + 4363 | output.join(',\n ') + 4364 | ' ' + 4365 | braces[1]; 4366 | } 4367 | 4368 | return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; 4369 | } 4370 | 4371 | 4372 | // NOTE: These type checking functions intentionally don't use `instanceof` 4373 | // because it is fragile and can be easily faked with `Object.create()`. 4374 | function isArray(ar) { 4375 | return Array.isArray(ar); 4376 | } 4377 | exports.isArray = isArray; 4378 | 4379 | function isBoolean(arg) { 4380 | return typeof arg === 'boolean'; 4381 | } 4382 | exports.isBoolean = isBoolean; 4383 | 4384 | function isNull(arg) { 4385 | return arg === null; 4386 | } 4387 | exports.isNull = isNull; 4388 | 4389 | function isNullOrUndefined(arg) { 4390 | return arg == null; 4391 | } 4392 | exports.isNullOrUndefined = isNullOrUndefined; 4393 | 4394 | function isNumber(arg) { 4395 | return typeof arg === 'number'; 4396 | } 4397 | exports.isNumber = isNumber; 4398 | 4399 | function isString(arg) { 4400 | return typeof arg === 'string'; 4401 | } 4402 | exports.isString = isString; 4403 | 4404 | function isSymbol(arg) { 4405 | return typeof arg === 'symbol'; 4406 | } 4407 | exports.isSymbol = isSymbol; 4408 | 4409 | function isUndefined(arg) { 4410 | return arg === void 0; 4411 | } 4412 | exports.isUndefined = isUndefined; 4413 | 4414 | function isRegExp(re) { 4415 | return isObject(re) && objectToString(re) === '[object RegExp]'; 4416 | } 4417 | exports.isRegExp = isRegExp; 4418 | 4419 | function isObject(arg) { 4420 | return typeof arg === 'object' && arg !== null; 4421 | } 4422 | exports.isObject = isObject; 4423 | 4424 | function isDate(d) { 4425 | return isObject(d) && objectToString(d) === '[object Date]'; 4426 | } 4427 | exports.isDate = isDate; 4428 | 4429 | function isError(e) { 4430 | return isObject(e) && 4431 | (objectToString(e) === '[object Error]' || e instanceof Error); 4432 | } 4433 | exports.isError = isError; 4434 | 4435 | function isFunction(arg) { 4436 | return typeof arg === 'function'; 4437 | } 4438 | exports.isFunction = isFunction; 4439 | 4440 | function isPrimitive(arg) { 4441 | return arg === null || 4442 | typeof arg === 'boolean' || 4443 | typeof arg === 'number' || 4444 | typeof arg === 'string' || 4445 | typeof arg === 'symbol' || // ES6 symbol 4446 | typeof arg === 'undefined'; 4447 | } 4448 | exports.isPrimitive = isPrimitive; 4449 | 4450 | exports.isBuffer = require('./support/isBuffer'); 4451 | 4452 | function objectToString(o) { 4453 | return Object.prototype.toString.call(o); 4454 | } 4455 | 4456 | 4457 | function pad(n) { 4458 | return n < 10 ? '0' + n.toString(10) : n.toString(10); 4459 | } 4460 | 4461 | 4462 | var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 4463 | 'Oct', 'Nov', 'Dec']; 4464 | 4465 | // 26 Feb 16:19:34 4466 | function timestamp() { 4467 | var d = new Date(); 4468 | var time = [pad(d.getHours()), 4469 | pad(d.getMinutes()), 4470 | pad(d.getSeconds())].join(':'); 4471 | return [d.getDate(), months[d.getMonth()], time].join(' '); 4472 | } 4473 | 4474 | 4475 | // log is just a thin wrapper to console.log that prepends a timestamp 4476 | exports.log = function() { 4477 | console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); 4478 | }; 4479 | 4480 | 4481 | /** 4482 | * Inherit the prototype methods from one constructor into another. 4483 | * 4484 | * The Function.prototype.inherits from lang.js rewritten as a standalone 4485 | * function (not on Function.prototype). NOTE: If this file is to be loaded 4486 | * during bootstrapping this function needs to be rewritten using some native 4487 | * functions as prototype setup using normal JavaScript does not work as 4488 | * expected during bootstrapping (see mirror.js in r114903). 4489 | * 4490 | * @param {function} ctor Constructor function which needs to inherit the 4491 | * prototype. 4492 | * @param {function} superCtor Constructor function to inherit prototype from. 4493 | */ 4494 | exports.inherits = require('inherits'); 4495 | 4496 | exports._extend = function(origin, add) { 4497 | // Don't do anything if add isn't an object 4498 | if (!add || !isObject(add)) return origin; 4499 | 4500 | var keys = Object.keys(add); 4501 | var i = keys.length; 4502 | while (i--) { 4503 | origin[keys[i]] = add[keys[i]]; 4504 | } 4505 | return origin; 4506 | }; 4507 | 4508 | function hasOwnProperty(obj, prop) { 4509 | return Object.prototype.hasOwnProperty.call(obj, prop); 4510 | } 4511 | 4512 | }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 4513 | },{"./support/isBuffer":9,"_process":8,"inherits":7}]},{},[5])(5) 4514 | }); --------------------------------------------------------------------------------