Restore support for breaks along line labels #12377
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Restores support for line breaks on labels placed along lines, which was (possibly unintentionally) removed in #8706. It's a useful feature, and it brings GL JS on par with both GL Native, and the way map renders in Studio, because it loads RTL text plugin by default (so line breaks handling is delegated to the plugin which does support them).
Closes #7203, closes #9743, ref GLJS-228.
At the moment we can't test this with a render test, because all render tests run with the RTL Text plugin loaded globally:
mapbox-gl-js/test/integration/lib/render.js
Line 23 in ced4597
We can try addressing this in a different PR. To prove that this PR fixes breaks along lines, I added a commit that disables RTL in tests to show how the multiline tests fail (disregarding RTL tests), then a commit return the fix in this PR with RTL still disabled to show that previously failing multiline tests pass, then finally restoring RTL to make the PR green. Example test:
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes — cc @tristenmapbox-gl-js
changelog:<changelog>Fix line breaks not working on labels along lines</changelog>