Skip to content

Instantly share code, notes, and snippets.

@fronteer-kr
Created August 18, 2015 05:08
Show Gist options
  • Save fronteer-kr/7f81f93d732656735730 to your computer and use it in GitHub Desktop.
Save fronteer-kr/7f81f93d732656735730 to your computer and use it in GitHub Desktop.
marked.js 에서 연속줄바꿈 처리 지원
// paragraph 내부의 연속 줄바꿈을 지원하도록!!
var block = {
newline: /^\n+/,
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
nptable: noop,
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
table: noop,
//paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, // 수정 (아랫것으로)
paragraph: /^((?:[^\n]*\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
text: /^[^\n]+/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment