Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .maestro/enrichedInput/flows/inline_styles_removal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
appId: swmansion.enriched.example
---
# PR #672 - fix: removing inline styles
- launchApp

- tapOn:
id: 'toggle-screen-button'

- tapOn:
id: 'editor-input'

- tapOn:
id: 'toolbar-bold'
- tapOn:
id: 'toolbar-italic'
- tapOn:
id: 'toolbar-underline'
- tapOn:
id: 'toolbar-strikethrough'

- inputText: 'First line'
- pressKey: Enter
- inputText: 'Second line'

- tapOn:
id: 'toolbar-code-block'

- runFlow:
file: '../subflows/capture_or_assert_screenshot.yaml'
env:
SCREENSHOT_NAME: 'inline_styles_removal'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,18 @@ class InlineStyles(
if (spans.isEmpty()) return false

for (span in spans) {
val spanStart = spannable.getSpanStart(span)
val spanEnd = spannable.getSpanEnd(span)

spannable.removeSpan(span)

if (spanStart < start) {
setSpan(spannable, config.clazz, spanStart, start - 1)
}

if (spanEnd > end) {
setSpan(spannable, config.clazz, end, spanEnd)
}
Comment thread
kacperzolkiewski marked this conversation as resolved.
}

return true
Expand Down
Loading