Skip to content

Reading the strings from an element does not preserve classes #627

@carafelix

Description

@carafelix

doing something like

<div id="typed-strings"> 
     <p class="text-red">line 1</p>
     <p class="text-orange">line </p>
</div>
<div id="typed"></div>

<script>
const _host = new Typed('#typed',{
    stringsElement: '#typed-strings'
  })
</script>

results in a non-stylized typed text

otherwise something like:

<template id="t">
  <span class="text-orange">line1</span>:
</template>

<script>
    const _host = new Typed('#typed', {
        strings: [document.getElementById('t')!.getHTML()]
    })
</script>

preserves classes

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