Sie sind nicht angemeldet.

a.pu

Schüler

  • »a.pu« ist der Autor dieses Themas

Beiträge: 120

Beruf: software engineer, author of krpano syntax highlighting, bundler and style guide

  • Nachricht senden

1

Dienstag, 4. August 2020, 18:35

Replacing <p></p> tag with div

When textfield sees <p></p> tag it replaces it with <div style="padding-top:2.5px; padding-bottom:5px;"></div>
And it also replaces other tags starting with 'p' like 'path' breaking HTML the layout.

I wonder why is it happening and is there any way to disable this behaviour?

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »a.pu« (23. September 2020, 10:26)


2

Mittwoch, 23. September 2020, 11:33

I guess if you want add complex html, then better avoid going through html="data:..."
create your layer and then add your stuff by javascript using layer.sprite
but be aware that kprano has its way to represent its layers/hotspots as html,
so not everything is in your control.

a.pu

Schüler

  • »a.pu« ist der Autor dieses Themas

Beiträge: 120

Beruf: software engineer, author of krpano syntax highlighting, bundler and style guide

  • Nachricht senden

3

Mittwoch, 23. September 2020, 11:42

I guess if you want add complex html, then better avoid going through html="data:..."
create your layer and then add your stuff by javascript using layer.sprite
but be aware that kprano has its way to represent its layers/hotspots as html,
so not everything is in your control.


More workarounds, yeah.
Btw works the same if I set html property from external JS

4

Freitag, 25. September 2020, 10:45

Hi,

the <p> to <div> replacement comes from the Flash-times to keep compatible with existing examples and gets the same results.

For using raw-html maybe have a look at this example:
https://krpano.com/examples/#pp-blur

and there at the 'add_html_code' action - it provides a way for adding direct unmodified html to a layer.

Best regards,
Klaus

a.pu

Schüler

  • »a.pu« ist der Autor dieses Themas

Beiträge: 120

Beruf: software engineer, author of krpano syntax highlighting, bundler and style guide

  • Nachricht senden

5

Freitag, 25. September 2020, 11:35

Hi,

the <p> to <div> replacement comes from the Flash-times to keep compatible with existing examples and gets the same results.

For using raw-html maybe have a look at this example:
https://krpano.com/examples/#pp-blur

and there at the 'add_html_code' action - it provides a way for adding direct unmodified html to a layer.

Best regards,
Klaus


Quellcode

1
caller.sprite.appendChild(div);


oh
ok