Skip to content

[v2] Can v1-style markdown components still be used? #1363

Answered by farnabaz
teegee asked this question in Q&A
Discussion options

You must be logged in to vote

Sadly this is not possible in V2. Content V1 used eval and new Function to evaluate these syntaxes, but due to security reasons, Content V2 does not use them.

However, there are alternative ways to pass props to components,

With frontmatter

---
images:
- - "./seiko-front.jpg"
  - ''
- - "./seiko-bottom.jpg"
  - ''
- - "./seiko-top.jpg"
  - ''
  -
---
<c-gallery title="As received" height="15rem" :images="images">
</c-gallery>

With MDC syntax and scoped variable


::c-gallery
---
title: As received
height: 15rem
images:
- - "./seiko-front.jpg"
  - ''
- - "./seiko-bottom.jpg"
  - ''
- - "./seiko-top.jpg"
  - ''
  -
---
::

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@teegee
Comment options

Answer selected by teegee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants