imdone-core 1.44.1 → 1.44.2
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/plugins/epic-plugin.js +12 -10
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const removeMD = require('remove-markdown')
|
|
1
|
+
// const removeMD = require('remove-markdown')
|
|
2
|
+
const { renderMarkdown } = require('../adapters/markdown')
|
|
2
3
|
const Plugin = require('imdone-api')
|
|
3
4
|
|
|
4
5
|
function getIsEpicMeta(task) {
|
|
@@ -104,7 +105,7 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
104
105
|
return
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
const epicText = removeMD(epic.text)
|
|
108
|
+
const epicText = epic.text // removeMD(epic.text)
|
|
108
109
|
const epicFilter = encodeURIComponent(
|
|
109
110
|
`(allMeta.epic="${epicId}" or allMeta.is-epic="${epicId}")`
|
|
110
111
|
)
|
|
@@ -114,13 +115,6 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
114
115
|
const epicUrl = `imdone://${epicFilePath}?line=${epic.line}&filter=${epicFilter}`
|
|
115
116
|
const epicLink = `**Epic:** [${epicText}](${epicUrl})\n\n`
|
|
116
117
|
|
|
117
|
-
const taskList =
|
|
118
|
-
epicLists.length === 0
|
|
119
|
-
? '*None*\n'
|
|
120
|
-
: '\n<div class="imdone-epic-items">\n\n' +
|
|
121
|
-
this.getTaskListMD(lists, epicFilter, epicUrl, epicId) +
|
|
122
|
-
'\n\n</div>\n'
|
|
123
|
-
|
|
124
118
|
// Add epic link to epic tasks
|
|
125
119
|
epicLists.forEach((list) => {
|
|
126
120
|
this.getEpicItems(epicId, list).forEach((task) => {
|
|
@@ -129,6 +123,13 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
129
123
|
})
|
|
130
124
|
})
|
|
131
125
|
|
|
126
|
+
const taskList =
|
|
127
|
+
epicLists.length === 0
|
|
128
|
+
? '*None*\n'
|
|
129
|
+
: '\n<div class="imdone-epic-items">\n\n' +
|
|
130
|
+
this.getTaskListMD(lists, epicFilter, epicUrl, epicId) +
|
|
131
|
+
'\n\n</div>\n'
|
|
132
|
+
|
|
132
133
|
if (epic.allMeta.epic && epic.allMeta.epic.includes(epicId)) {
|
|
133
134
|
const index = epic.allMeta.epic.findIndex((value) => value === epicId)
|
|
134
135
|
epic.allMeta.epic.splice(index, 1)
|
|
@@ -145,6 +146,7 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
145
146
|
|
|
146
147
|
lists
|
|
147
148
|
.filter((list) => this.getEpicItems(epicId, list.name))
|
|
149
|
+
.reverse()
|
|
148
150
|
.forEach((list) => {
|
|
149
151
|
const tasks = this.getEpicItems(epicId, list.name)
|
|
150
152
|
const listUrl = epicUrl + encodeURIComponent(` and list=${list.name}`)
|
|
@@ -153,7 +155,7 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
153
155
|
content += '<ul style="list-style: none;">'
|
|
154
156
|
content += tasks
|
|
155
157
|
.map((task) => {
|
|
156
|
-
const taskText = removeMD(task.text)
|
|
158
|
+
const taskText = renderMarkdown(task.text).replaceAll(/<p>|<\/p>/ig, '') // removeMD(task.text)
|
|
157
159
|
const checked =
|
|
158
160
|
task.list === this.project.doneList ? ' checked="true"' : ''
|
|
159
161
|
const taskFilePath = encodeURI(
|