ep_markdown
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -84,3 +84,3 @@ /** | ||
var headingtags = ['# ', '## ', '### ', '#### ', '##### ', '###### ', '``']; | ||
var headingtags = ['# ', '## ', '### ', '#### ', '##### ', '###### ', ' ']; | ||
var headingprops = [['heading', 'h1'], ['heading', 'h2'], ['heading', 'h3'], ['heading', 'h4'], ['heading', 'h5'], ['heading', 'h6'], ['heading', 'code']]; | ||
@@ -153,3 +153,2 @@ var headinganumMap = {}; | ||
var heading = false; | ||
var isCode = false; | ||
var deletedAsterisk = false; // we need to delete * from the beginning of the heading line | ||
@@ -172,7 +171,2 @@ var iter2 = Changeset.opIterator(Changeset.subattribution(attribs, 0, 1)); | ||
if (heading) { | ||
if(heading === "``"){ | ||
isCode = true; | ||
}else{ | ||
isCode = false; | ||
} | ||
assem.append(heading); | ||
@@ -332,6 +326,2 @@ } | ||
if (isCode) { | ||
assem.append('``'); | ||
} | ||
// replace &, _ | ||
@@ -338,0 +328,0 @@ assem = assem.toString(); |
20
index.js
@@ -35,18 +35,18 @@ var path = require('path'); | ||
console.log("ep_markdown handling import", args); | ||
if(args.fileEnding.indexOf(".md") === -1) return callback(); | ||
// It is Markdown file, let's go! | ||
if(args.fileEnding.indexOf(".md") !== -1){ | ||
var markdown = fs.readFileSync(args.srcFile, 'utf-8'); | ||
var showdown = require('showdown'); | ||
var converter = new showdown.Converter({completeHTMLDocument: true}); | ||
console.log("markdown imported file.."); | ||
var html = converter.makeHtml(markdown); | ||
fs.writeFile(args.destFile, "some contents", 'utf8', function(err){ | ||
fs.writeFile(args.destFile, html, 'utf8', function(err){ | ||
if(err) callback(err, null); | ||
callback(args.destFile); | ||
if(err) callback(err, null); | ||
callback(args.destFile); | ||
}); | ||
}); | ||
}else{ | ||
callback(false); | ||
} | ||
} |
{ | ||
"name": "ep_markdown", | ||
"description": "Edit and Export as Markdown in Etherpad", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": { | ||
@@ -14,7 +14,10 @@ "name": "John McLear", | ||
}, | ||
"dependencies": { | ||
"showdown": "*" | ||
}, | ||
"contributors": [], | ||
"peerDependencies": { | ||
"ep_headings2" :"*" | ||
"ep_headings2": "*" | ||
}, | ||
"license": "Apache-2.0" | ||
} |
@@ -6,9 +6,22 @@ Markdown editing in Etherpad | ||
Use the normal editbar buttons to add markdown. | ||
Export as Markdown. | ||
Features | ||
======== | ||
* Use the normal editbar buttons to add markdown. | ||
* Import as Markdown (automatically applies styling / text attributes). | ||
* Export as Markdown. | ||
* Localizations. | ||
Usage | ||
===== | ||
To enable Markdown view click Settings -> Markdown | ||
Limitations | ||
=========== | ||
This plugin is not designed for you to write Markdown and it format that markdown with styling. So you can't expect to type \*\*blah\*\* and expect to see blah in bold. You can however type blah, set it as bold and then click "Show as Markdown" and it will show \*\*bold\*\*. I will not be adding support for supporting typing in markdown which will render to a style because it will be impossible to handle character control. | ||
Setting as default | ||
================== | ||
Paste the below into your settings. | ||
@@ -18,7 +31,12 @@ | ||
todo | ||
Todo | ||
==== | ||
* Support all styles fully | ||
* Support ALL styles fully (please let me know what does / doesn't work) | ||
* Create markdown icon for export menu | ||
* Better code block support (currently it's line by line) | ||
* Import Markdown (and it applies formatting automatically) | ||
Contact me to sponsor dev. | ||
Requirements | ||
============ | ||
Etherpad 1.8.1 |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33144
41
2
731
2
+ Addedshowdown@*
+ Addedcommander@9.5.0(transitive)
+ Addedshowdown@2.1.0(transitive)