Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Equation starting with parenthesis interpreted as link #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ describe('compiler', function() {
var results = lex("\n## my title");
expect(results.tokens).to.eql('HEADER_2 TOKEN_VALUE_START "my title" TOKEN_VALUE_END EOF');
});

it('should handle newlines', function() {
var lex = Lexer();
var results = lex("\n\n\n\n text \n\n");
expect(results.tokens.split(' ')).to.eql(['WORDS', 'TOKEN_VALUE_START', '\"text\"', 'TOKEN_VALUE_END', 'EOF']);
});

it('should handle equations that start with a parenthesis', function () {
var lex = Lexer();
var results = lex("[Equation](y)[/Equation]");
expect(results.tokens).to.eql('OPEN_BRACKET COMPONENT_NAME TOKEN_VALUE_START "Equation" TOKEN_VALUE_END CLOSE_BRACKET WORDS TOKEN_VALUE_START "(y)" TOKEN_VALUE_END OPEN_BRACKET FORWARD_SLASH COMPONENT_NAME TOKEN_VALUE_START "Equation" TOKEN_VALUE_END CLOSE_BRACKET EOF');
});

it('should handle backticks in a paragraph', function() {
var lex = Lexer();
var results = lex("regular text and stuff, then some `code`");
Expand Down