nuejs/nue

Nuemark: How to add svg inside a button

Korab-Doroci opened this issue · 3 comments

Describe the Bug

Using Nuemark, I can't get this example to work. The only way I found to get around it is to make the button a div, but that is not the behaviour I'm after.

This doesn't work:
[button]
[mysvg]
Learn More

This works but isn't a button:
[button]
[mysvg]
Learn More

Environment

Example:

  • OS: Arch Linux
  • Package Manager: bun 1.1.8
  • JS Runtime: bun 1.1.8
  • Nuekit Version: nue 0.5.3

Minimal Reproduction

  1. Create a new skeleton project using bun create nue
  2. Add an svg of choice inside of layout.html, and give the svg a @name="mysvg"
  3. Inside index.md, add a the code from the example that doesn't work

I have made a small change in the nuemark code to enable svgs and other components inside of buttons now. The only limitation I found was that the components cant be inside the layout.html, needs to be in a .nue file. Is this something that is worth creating a pull request for?

Sure, give it a try, maybe we even find a way to allow layout components.

(The latest merge commit has some problems test-wise with jest currently. You can test jest without it, if you do your changes after git reset --hard HEAD~1. Test commands / environment can be found here)

nobkd commented

Closing, see: #280 (comment)