Skip to content

External HTML components escaped #9

Open

Description

@vimbrandt

Hi! 👋
I'm working on a component helper library to be shared across multiple projects, which uses ucontent to generate server-side markup for each component. However, the two separate instances of ucontent (component lib & project) are incompatible for rendering markup. The component markup is escaped as text instead of live html (but works properly if I copy/paste the component library source into the project repo and use the same ucontent instance).

I believe the problem is caused by the prefix for uparser in utils.js using Date.now(). Is this timestamp necessary for proper functionality?

I've cloned the repo here and removed the timestamp, which seems to fix things. I'm cautious though, since I'm not sure if the internal parser depends on a unique prefix for proper caching / whatnot.

Happy to create a demonstration repo if that helps.

Thanks for your help and your great collection of libraries!

Activity

  1. WebReflection commented on Sep 16, 2020

    @WebReflection
    Owner

    Happy to create a demonstration repo if that helps.

    yes please, as I've no idea what you are actually talking about. any reduced test case that shows what/where is the issue would help me helping you.

    thanks

  2. vimbrandt commented on Sep 16, 2020

    @vimbrandt
    Author

    Demo repo with an external and internal component

    Hope this helps. Let me know if there's anything else I can do or if I'm misunderstanding something.

  3. vimbrandt commented on Sep 16, 2020

    @vimbrandt
    Author

    Upon further investigation, my initial guess of the problem was incorrect. The "fix" was using a local version of ucontent and using "npm link" instead of referencing a remote module.

    Has nothing to do with the timestamp, and I've updated the demo repo to reproduce the local vs remote ucontent discrepancy.

    Seems like ucontent treats independent ucontent instances as foreign and escapes them. Currently working around this by wrapping my imported components with raw(), but I'd prefer to import directly if that's possible (-:

  4. changed the title [-]uparser prefix timestamp[/-] [+]External components escaped[/+] on Sep 16, 2020
  5. changed the title [-]External components escaped[/-] [+]External HTML components escaped[/+] on Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions