Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Source attribution should be object-oriented #7361

@1ec5

Description

@1ec5

MGLTileSet’s attribution property – which may soon live on MGLTileSource; see #7360 – should be an array of objects containing structured attribution information. We can use the MGLAttributionInfo class being added in #5999 to represent a single attribution item.

The current MGLTileSet.attribution property is a single string containing HTML code. This encourages developers to manually craft HTML strings, which can be error-prone. It also means any developer who wants to make sense of a preexisting attribution string would have to parse it as HTML. Done incorrectly, both operations can be avenues for HTML injection. Since #5999 already parses the HTML source code into structured attribution, I don’t think there’s really a use case for working with the raw source code as opposed to, say, an attributed string (which can always be converted back to HTML if needed).

/cc @boundsj @friedbunny

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions