##// END OF EJS Templates
handle nodejs executable on debian...
MinRK -
Show More
@@ -67,7 +67,7 b' def markdown2html_pandoc(source):'
67
67
68 def markdown2html_marked(source, encoding='utf-8'):
68 def markdown2html_marked(source, encoding='utf-8'):
69 """Convert a markdown string to HTML via marked"""
69 """Convert a markdown string to HTML via marked"""
70 command = ['node', marked]
70 command = [node_cmd, marked]
71 try:
71 try:
72 p = subprocess.Popen(command,
72 p = subprocess.Popen(command,
73 stdin=subprocess.PIPE, stdout=subprocess.PIPE
73 stdin=subprocess.PIPE, stdout=subprocess.PIPE
@@ -99,9 +99,18 b' def markdown2rst(source):'
99 """
99 """
100 return pandoc(source, 'markdown', 'rst')
100 return pandoc(source, 'markdown', 'rst')
101
101
102 # prefer md2html via marked if node.js is available
103 # node is called nodejs on debian, so try that first
104 node_cmd = 'nodejs'
102 try:
105 try:
103 find_cmd('node')
106 find_cmd(node_cmd)
104 except FindCmdError:
107 except FindCmdError:
105 markdown2html = markdown2html_pandoc
108 node_cmd = 'node'
109 try:
110 find_cmd(node_cmd)
111 except FindCmdError:
112 markdown2html = markdown2html_pandoc
113 else:
114 markdown2html = markdown2html_marked
106 else:
115 else:
107 markdown2html = markdown2html_marked
116 markdown2html = markdown2html_marked
General Comments 0
You need to be logged in to leave comments. Login now