mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-19 16:08:07 +02:00
feat(#121): add support for org files
This commit is contained in:
@@ -1340,6 +1340,9 @@ angular
|
||||
if (extension == "md") {
|
||||
return "md";
|
||||
}
|
||||
if (extension == "org") {
|
||||
return "org";
|
||||
}
|
||||
if (extension == "ipynb") {
|
||||
return "IPython";
|
||||
}
|
||||
@@ -1380,6 +1383,20 @@ angular
|
||||
$scope.content = marked(md, { baseUrl: $location.url() });
|
||||
$scope.type = "html";
|
||||
}
|
||||
if ($scope.type == "org") {
|
||||
const content = contentAbs2Relative(res.data);
|
||||
|
||||
const orgParser = new Org.Parser();
|
||||
const orgDocument = orgParser.parse(content);
|
||||
var orgHTMLDocument = orgDocument.convert(Org.ConverterHTML, {
|
||||
headerOffset: 1,
|
||||
exportFromLineNumber: false,
|
||||
suppressSubScriptHandling: false,
|
||||
suppressAutoLink: false,
|
||||
});
|
||||
$scope.content = orgHTMLDocument.toString();
|
||||
$scope.type = "html";
|
||||
}
|
||||
setTimeout(() => {
|
||||
Prism.highlightAll();
|
||||
}, 50);
|
||||
|
||||
Vendored
+1650
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user