Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown images are still enabled #196

Closed
lucaslcode opened this issue Aug 18, 2020 · 4 comments
Closed

Markdown images are still enabled #196

lucaslcode opened this issue Aug 18, 2020 · 4 comments

Comments

@lucaslcode
Copy link
Member

No description provided.

@lucaslcode
Copy link
Member Author

It's a one character typo in the package, I made a pull request

If they don't merge it soonish we can change packages

@aapeliv
Copy link
Member

aapeliv commented Aug 19, 2020

I think it would be better to anyway switch to a plain converter (markdown to HTML), the current package also styles it a bit which makes it ever so slightly inconsistent with the rest of the UI (it changes fonts, etc).

I've used markdown-it. We use that on the static site too, actually:

import markdown from 'markdown-it'
const mkd = new markdown()
export default {
async asyncData({params, error}) {
let filename = params.pathMatch
if (filename.substring(filename.length - 1) === "/") {
filename = filename.substring(0, filename.length - 1)
}
let md
try {
md = await import(`@/markdown/${filename}.md`)
} catch (err) {
error({ statusCode: 404, message: 'Page not found' })
}
const split_items = filename.split("/")
let items = []
for (let i = 0; i < split_items.length; i++) {
const item = split_items[i]
items.push({
key: item,
value: i == split_items.length - 1 ? (md.attributes.crumb ? md.attributes.crumb : md.attributes.title) : item.substring(0, 1).toUpperCase() + item.substring(1, item.length),
path: (i == 0 ? "" : items[i-1].path) + "/" + item
})
}
if (md.attributes.subtitle) {
md.attributes.subtitle = mkd.renderInline(md.attributes.subtitle)
}
if (md.attributes.bustitle) {
md.attributes.bustitle = mkd.renderInline(md.attributes.bustitle)
}
return {...md, breadcrumbs: items }
},

@kalvdans
Copy link
Member

It's a one character typo in the package, I made a pull request

If they don't merge it soonish we can change packages

We could point to your fix in the meantime:

modified   app/frontend/package.json
@@ -19,7 +19,7 @@
     "vue-class-component": "^7.2.3",
     "vue-property-decorator": "^8.4.2",
     "vue-router": "^3.2.0",
-    "vue-simple-markdown": "^1.1.4",
+    "vue-simple-markdown": "lucaslcode/vue-simple-markdown#fix-image-prop",
     "vuetify": "^2.2.11",
     "vuex": "^3.4.0",
     "vuex-persistedstate": "^3.0.1"

@aapeliv
Copy link
Member

aapeliv commented Aug 19, 2020

You're a wizard Christian!

lucaslcode added a commit that referenced this issue Aug 19, 2020
move to markdown-it #196
signup page checks #206
forum link new tab #207
add hosting status to signup page
@aapeliv aapeliv closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants