summaryrefslogtreecommitdiff
path: root/js/lib/blocks.js
AgeCommit message (Collapse)Author
2015-01-15Added getType(), setType() to node.js.John MacFarlane
Use these instead of direct property access. This is the first step in a general move towards an API like the one libcmark has. This will allow us to have a stable API that is independent of details of the AST.
2015-01-15Removed artificial distinction btw FencedCode, IndentedCodeJohn MacFarlane
in blocks.js.
2015-01-14Slightly more efficient test for lazy continuation.John MacFarlane
2015-01-13Initialize fields in objects to null rather than undefined.John MacFarlane
Big speed boost.
2015-01-13blocks.js - avoid an implicit boolean cast.John MacFarlane
2015-01-13Simplified some of the new-block-start logic.John MacFarlane
2015-01-13Assign marker_offset to list data at initialization.John MacFarlane
2015-01-13last_matched_container -> lastMatchedContainer.John MacFarlane
2015-01-13Ensure that closeUnmatchedBlocks is not called unnecessarily.John MacFarlane
2015-01-13Fixed start column for blockquotes.John MacFarlane
2015-01-13Added lineNumber proper to DocParser.John MacFarlane
Removed lineNumber param from addChild and some other methods.
2015-01-12Made closeUnmatchedBlocks a method of DocParser...John MacFarlane
instead of a closure. Performance increase and code simplification.
2015-01-12Use new with Document and NodeWalker constructors.John MacFarlane
2015-01-12Moved "use strict" to top of modules.John MacFarlane
2015-01-11Factored out unescapeString into new module, js/common.js.John MacFarlane
This is used in both blocks.js and inlines.js.
2015-01-11js: 'ListItem' -> 'Item'.John MacFarlane
2015-01-10More efficient detab.John MacFarlane
2015-01-10Timings: added 'preparing input'.John MacFarlane
2015-01-10Added options to DocParser.John MacFarlane
So far only 'time' is supported. 'time' now gives a breakdown of block parsing, inline parsing, and rendering. Currently the ratio is block parsing: 725ms inline parsing: 332ms rendering: 213ms so perhaps block.js is the best place to look for further optimizations.
2015-01-10Removed an unnecessary variable from cloneUnmatchedBlocks.John MacFarlane
2015-01-10Small performance optimization in dealing with final newline.John MacFarlane
2015-01-10Reordered some definitions, so regex is defined before being used.John MacFarlane
2015-01-10Regex optimizations in blocks.js.John MacFarlane
2015-01-09Removed redundant condition.John MacFarlane
2015-01-09JS linter improvements.John MacFarlane
2015-01-09Improved newline parsing efficiency.John MacFarlane
Don't check for `\n` when we know we have one. Gobble spaces after line break.
2015-01-09JS: Renamed 'c' property to 'literal' to match libcmark.John MacFarlane
2015-01-09JS: sourceloc -> sourcepos for confirmity with cmark.John MacFarlane
2015-01-09Replaced 'pos' with 'sourceloc', making it an array.John MacFarlane
This is a more compact representation.
2015-01-09Added end column position to pos for blocks.John MacFarlane
2015-01-09JS: Improved end lines.John MacFarlane
Closes #276.
2015-01-09JS: use c rather than string_content property for code blocks, html.John MacFarlane
string_content is just for the raw string content that will be parsed as inlines, not for the 'real' content of the block element.
2015-01-09Don't initialize strings, string_content to defined value.John MacFarlane
2015-01-09Made `tight` a property of `list_data`.John MacFarlane
2015-01-09Removed makeBlock. Use new Node directly. Initialize more fields.John MacFarlane
2015-01-09JS: replace NUL characters with U+FFFD, as per spec.John MacFarlane
2015-01-09More JS linter fixes.John MacFarlane
2015-01-09Use linked list instead of arrays for AST.John MacFarlane
Use the same doubly linked node structure that cmark uses. The primary advantages of this change are (a) simplified code, especially in the renderers, and (b) elimination of the need for recursion, so we can render deeply-nested structures without a stack overflow. A node walker has also been added, for easy AST traversal. * Added js/lib/node.js for nodes. Includes a node walker. * All modules updated to use node structures. * Regularized position information into pos property. * Performance is slightly worse than before, but only marginally, and no doubt there are more optimizations that can be done.
2015-01-07js: Use children instead of inline_content for Paragraph.John MacFarlane
2014-12-27Minor whitespace fixes.John MacFarlane
2014-12-10More js delinting.John MacFarlane
2014-12-10More linter corrections to js code.John MacFarlane
2014-11-23js: use 'CodeBlock' in AST for all code blocks.John MacFarlane
Don't distinguish fenced, indented.
2014-11-23Revert "Revert "Remove distinction btw atx and setext header in AST.""John MacFarlane
This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24.
2014-11-22Revert "Remove distinction btw atx and setext header in AST."John MacFarlane
This reverts commit a71423f6ee1b77d9f79d42599ea00b4ca99f5da0. Not quite sure about this change, so reverting for now. Note that we still have a distinction between fenced and indented code blocks in the AST. These two distinctions seem to stand or fall together.
2014-11-22Remove distinction btw atx and setext header in AST.John MacFarlane
Now we just have 'header' -- Setext and ATX are just two ways of forming these; it's not a semantic difference that should remain in the AST.
2014-11-22Fixed #192.John MacFarlane
The C and JS implementations were not registering blank lines after atx headers for purposes of tight/loose list calculation. Exmaple: * item * # block1 ## block2
2014-11-22Updated JS and C implementations for #209.John MacFarlane
A setext header was being treated a if it were a blank line for purposes of tight/loose list determination. Closes #209.
2014-10-30js/lib/blocks: Made matchAt return -1 instead of null on no match.John MacFarlane
2014-10-26Require space before closing # sequence in ATX header.John MacFarlane
Closes #169.