summaryrefslogtreecommitdiff
path: root/js/lib/blocks.js
AgeCommit message (Collapse)Author
2015-01-17Renamed DocParser -> Parser.John MacFarlane
Note: library users should update their code or it will break.
2015-01-17Reverted addition of offset property to DocParser.John MacFarlane
Also reverted subtraction of offset param from addLine.
2015-01-17Moved place where we increment line number.John MacFarlane
2015-01-17Removed a check in addLine.John MacFarlane
2015-01-17addLine: use this.offset; removed offset parameter.John MacFarlane
2015-01-17Added offset property to DocParser.John MacFarlane
2015-01-17Moved check for closing fence to close-block-check section.John MacFarlane
This is a more logical arrangement.
2015-01-17Minor code simplification.John MacFarlane
2015-01-17Performance optimization - avoid repeating scan for nonspace.John MacFarlane
2015-01-17Slightly adjusted performance optimization in new block starts.John MacFarlane
2015-01-17Minor code cleanup.John MacFarlane
2015-01-16Defer closing of fenced code blocks.John MacFarlane
Instead of closing a fenced code block when we see the closing fence, we set fenceLength to -1, which then signals the code that checks for block enders that it is time to close the block. This allows us to process a blank line after the fenced code and set _lastLineBlank appropriately. Addresses #285 for JS implementation.
2015-01-16Removed unnecessary setting of default tight=true in finalize.John MacFarlane
We do that when the listData object is initialized.
2015-01-16Check for blank line before checking indent in Item.John MacFarlane
2015-01-16Rename bullet_char -> bulletChar.John MacFarlane
2015-01-15Provide getters and setters for public properties of Node.John MacFarlane
Everything else gets a name starting with an underscore and will be considered private. This will allow us to keep the API stable while changing the underlying data structure. And it will avoid exposing properties that have only an instrumental value in parsing.
2015-01-15Rename sourcepos -> _sourcepos, added sourcepos() accessor.John MacFarlane
2015-01-15Removed setType(), replaced getType() with type().John MacFarlane
2015-01-15Removed vestigial ReferenceDef node type.John MacFarlane
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.