Skip to content
New issue

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

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

Already on GitHub? # to your account

Section with custom attribute #805

Open
ngocducdim opened this issue Aug 19, 2022 · 0 comments
Open

Section with custom attribute #805

ngocducdim opened this issue Aug 19, 2022 · 0 comments

Comments

@ngocducdim
Copy link

Hi, can we add some custom attribute like WordPress shortcode in section?, for example from this:

{
  "fontWeight": function () {
    return function (text, render) {
      return '<p style="font-weight: 400">' + render(text) + '</p>';
    }
  }
}
{{#fontWeight}}
  This text is 700
{{/fontWeight}}

to be like this:

{
  "fontWeight": function () {
    return function (text, render, props) {
      return `<p style="font-weight: ${props.size}">` + render(text) + '</p>';
    }
  }
}
{{#fontWeight[size=700]}}
  This text is 700
{{/fontWeight}}

is it possible?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ngocducdim and others