Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline scripts (like for maps) are included in the rendered HTML from the WA API and need to be stripped, either upstream or downstream. #9

Open
cswendrowski opened this issue Jun 13, 2020 · 4 comments
Labels
bug Functionality which is not working as intended wa-api Issues which need additional features from the World Anvil API in order to become possible. wa-input Issues which need input from the World Anvil team

Comments

@cswendrowski
Copy link

In GitLab by @vbfischer on Jun 13, 2020, 13:49

Imported article that contained map. Map does not display.

Seeing the following error in console:

jquery.min.js:2 Uncaught ReferenceError: L is not defined
    at <anonymous>:2:17
    at b (jquery.min.js:2)
    at Pe (jquery.min.js:2)
    at S.fn.init.append (jquery.min.js:2)
    at JournalSheet._injectHTML (foundry.js:4018)
    at JournalSheet._render (foundry.js:3869)
    at async JournalSheet._render (foundry.js:4455)

Presumably related to the following source in the HTML of the article:

var labelIcon = new L.Icon({
    iconUrl: '/images/markers/marker-icon-transparent.png',
    iconSize: [150, 35],
    iconAnchor: [75, 15],
    popupAnchor: [0, -20],
})
...

@cswendrowski
Copy link
Author

In GitLab by @vbfischer on Jun 13, 2020, 18:07

Presumably its because it doesn't include the leaflet lib

@cswendrowski
Copy link
Author

In GitLab by @worldanvil on Jun 13, 2020, 23:34

It feels like trying to include support for maps from WA into FVTT is a bit of an overkill - there is a lot of logic there - but we certainly need to find a way to handle their display / or lack thereof gracefully.

@cswendrowski
Copy link
Author

I didn't realize that WA articles could contain inline scripts like this. I'll definitely need to strip those out on the Foundry side - although perhaps they should not be included in the return from the API in the first place.

@cswendrowski
Copy link
Author

In GitLab by @vbfischer on Jun 15, 2020, 11:14

Maybe a link to the map? (note, not the article itself, but directly to the map?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended wa-api Issues which need additional features from the World Anvil API in order to become possible. wa-input Issues which need input from the World Anvil team
Projects
None yet
Development

No branches or pull requests

1 participant