diff --git a/md2tex b/md2tex index c493544..38f093e 100755 --- a/md2tex +++ b/md2tex @@ -45,8 +45,8 @@ function inline(text) { gsub(/&/, "\\\\&", text) gsub(/\^/, "\\textasciicircum ", text) gsub(/\.{3,}/, "\\ldots", text) - text = gensub(/\*\*([^\*]*)\*\*/, "\\textbf{\\1}", "g", text) - text = gensub(/\*([^\*]*)\*/, "\\emph{\\1}", "g", text) + text = gensub(/\*\*([^*]+)\*\*/, "\\textbf{\\1}", "g", text) + text = gensub(/\*([^*]+)\*/, "\\emph{\\1}", "g", text) text = gensub(/`([^`]*)`/, "\\texttt{\\1}", "g", text) # links text = gensub(/\[(.*)\]\((.*)\)/, "\\href{\\2}{\\1}\\footnote{\\url{\\2}}", "g", text)