Skip to content

Named Partials render with documentFragment in stringOnly state instead of expected string result #710

@JaneOri

Description

@JaneOri

I understand this may be marked as "won't fix" or at least probably isn't a priority since there are ways to work around it and most wouldn't ever need it. I took a few swings at fixing it but didn't get far in the time I have.

How often can you reproduce it?

  • Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description:

Named partials (technically section renderer) produce document fragments even when stringOnly is true in the section its being rendered in (in a style tag, for example).


"res" is a documentFragment at that line when a named partial is rendered inside of style tag.

The text representation should be rendered instead.

Steps to reproduce:

https://codepen.io/anon/pen/eqRVZG?&editable=true&editors=0011

Expected results:

contents of style tag should be the raw text produced by the render. (Note: "innerHTML" of the fragment produced would be incorrect in the browser because it escapes things like ">" automatically)

Actual results:

contents of the style tag is "[object DocumentFragment]"

Environment:

Software Version
can-stache version latest
Browser chrome
Operating system windows 10

Thank you for your time!
//James

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions