Skip to content

Commit

Permalink
Fix markdown link parsing
Browse files Browse the repository at this point in the history
Still not perfect, but this solves incorrectly capturing `[link` with something like `[[link](href)]`
  • Loading branch information
cookpete committed Feb 3, 2016
1 parent 04e8f58 commit 7eef38c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'isomorphic-fetch'
import { stringify } from 'query-string'

const REDDIT_URL = 'https://www.reddit.com'
const MATCH_REPLY_URLS = /(?:\[([^\]]+)\]\s*\()?(https?\:\/\/[^\)\s]+)\)?/gi
const MATCH_REPLY_URLS = /(?:\[+([^\]]+)\]\s*\()?(https?\:\/\/[^\)\s]+)\)?/gi
const REPLACE_CHAR = String.fromCharCode(0)
const INFER_TITLE_MAX_LENGTH = 128 // Max length of remaining text to use as a title for a link
const MATCH_YOUTUBE_URL = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
Expand Down

0 comments on commit 7eef38c

Please sign in to comment.