markdown-magic 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/process-contents.js +2 -0
- package/lib/process-file.js +2 -1
- package/package.json +1 -1
package/lib/process-contents.js
CHANGED
|
@@ -230,6 +230,8 @@ async function processContents(text, config) {
|
|
|
230
230
|
/* Strip block comments from output files */
|
|
231
231
|
const stripComments = isNewPath && removeComments
|
|
232
232
|
|
|
233
|
+
// console.log('srcPath', srcPath)
|
|
234
|
+
// console.log('outputPath', outputPath)
|
|
233
235
|
const result = {
|
|
234
236
|
/* Has markdown content changed? */
|
|
235
237
|
isChanged: text !== updatedContents,
|
package/lib/process-file.js
CHANGED
|
@@ -49,7 +49,8 @@ async function processFile(opts = {}) {
|
|
|
49
49
|
return result
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/* If it's changed or its a new file to write */
|
|
53
|
+
if (result.isChanged || result.isNewPath) {
|
|
53
54
|
let cleanContents = result.updatedContents
|
|
54
55
|
if (result.stripComments && patterns.openPattern && patterns.closePattern) {
|
|
55
56
|
cleanContents = result.updatedContents.replace(patterns.openPattern, '').replace(patterns.closePattern, '')
|