Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://github.com/chjj/marked.git@708 de94abd1-4c94-9ff3-2ac9-ce57b7db7bff
  • Loading branch information
Unknown committed Dec 18, 2017
1 parent fd25ebe commit e9bd470
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 111 deletions.
11 changes: 11 additions & 0 deletions trunk/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Expectation

<!-- Describe the output you are expecting from marked -->

## Result

<!-- Describe the output you received from marked -->

## What was attempted

<!-- Describe what code combination got you there -->
4 changes: 2 additions & 2 deletions trunk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ default with the old behavior moved into `pedantic`.
Type: `boolean`
Default: `false`

Use "smart" typograhic punctuation for things like quotes and dashes.
Use "smart" typographic punctuation for things like quotes and dashes.

## Access to lexer and parser

Expand Down Expand Up @@ -297,7 +297,7 @@ $ cat hello.html

The point of marked was to create a markdown compiler where it was possible to
frequently parse huge chunks of markdown without having to worry about
caching the compiled output somehow...or blocking for an unnecesarily long time.
caching the compiled output somehow...or blocking for an unnecessarily long time.

marked is very concise and still implements all markdown features. It is also
now fully compatible with the client-side.
Expand Down
1 change: 1 addition & 0 deletions trunk/bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "marked",
"version": "0.3.4",
"homepage": "https://github.com/chjj/marked",
"authors": [
"Christopher Jeffrey <chjjeffrey@gmail.com>"
Expand Down
41 changes: 3 additions & 38 deletions trunk/lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ block.list = replace(block.list)
('def', '\\n+(?=' + block.def.source + ')')
();

block.blockquote = replace(block.blockquote)
('def', block.def)
();

block._tag = '(?!(?:'
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
+ '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
Expand Down Expand Up @@ -457,7 +453,7 @@ var inline = {
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)([\s\S]*?[^`])\1(?!`)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop,
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
Expand Down Expand Up @@ -661,7 +657,7 @@ InlineLexer.prototype.output = function(src) {
// code
if (cap = this.rules.code.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.codespan(escape(cap[2].trim(), true));
out += this.renderer.codespan(escape(cap[2], true));
continue;
}

Expand Down Expand Up @@ -879,9 +875,6 @@ Renderer.prototype.link = function(href, title, text) {
return '';
}
}
if (this.options.baseUrl && !originIndependentUrl.test(href)) {
href = resolveUrl(this.options.baseUrl, href);
}
var out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"';
Expand All @@ -891,9 +884,6 @@ Renderer.prototype.link = function(href, title, text) {
};

Renderer.prototype.image = function(href, title, text) {
if (this.options.baseUrl && !originIndependentUrl.test(href)) {
href = resolveUrl(this.options.baseUrl, href);
}
var out = '<img src="' + href + '" alt="' + text + '"';
if (title) {
out += ' title="' + title + '"';
Expand Down Expand Up @@ -1125,30 +1115,6 @@ function replace(regex, opt) {
};
}

function resolveUrl(base, href) {
if (!baseUrls[' ' + base]) {
// we can ignore everything in base after the last slash of its path component,
// but we might need to add _that_
// https://tools.ietf.org/html/rfc3986#section-3
if (/^[^:]+:\/*[^/]*$/.test(base)) {
baseUrls[' ' + base] = base + '/';
} else {
baseUrls[' ' + base] = base.replace(/[^/]*$/, '');
}
}
base = baseUrls[' ' + base];

if (href.slice(0, 2) === '//') {
return base.replace(/:[^]*/, ':') + href;
} else if (href.charAt(0) === '/') {
return base.replace(/(:\/*[^/]*)[^]*/, '$1') + href;
} else {
return base + href;
}
}
baseUrls = {};
originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;

function noop() {}
noop.exec = noop;

Expand Down Expand Up @@ -1283,8 +1249,7 @@ marked.defaults = {
smartypants: false,
headerPrefix: '',
renderer: new Renderer,
xhtml: false,
baseUrl: null
xhtml: false
};

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/marked.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions trunk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion trunk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "marked",
"description": "A markdown parser built for speed",
"author": "Christopher Jeffrey",
"version": "0.3.9",
"version": "0.3.7",
"main": "./lib/marked.js",
"bin": "./bin/marked",
"man": "./man/marked.1",
Expand Down
4 changes: 3 additions & 1 deletion trunk/test/tests/def_blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<hr>

<blockquote>
<p>hello</p>
<p>hello
[2]: hello</p>
</blockquote>


Expand All @@ -24,5 +25,6 @@
<blockquote>
<p>foo
bar
[1]: foo
bar</p>
</blockquote>

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions trunk/test/tests/toplevel_paragraphs.gfm.text
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ hello world
<span>how are you</span>

hello [world][how]

[how]: /are/you

<div>hello</div>
Expand Down

0 comments on commit e9bd470

Please sign in to comment.