Skip to content

Commit 19377c0

Browse files
authored
Merge pull request #554 from wordpress-mobile/issue/fixing-missing-href-in-url-with-parameters
Fixed URL span attributes
2 parents f824e87 + ea58ffa commit 19377c0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- The text handling following immediately after images
66
- Undo/redo edit history
77
- The demo app sample text
8+
- URL span not including href attribute when other attributes are present
89

910
## [1.0-beta.11](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.0-beta.11) - 2017-11-20
1011
### Fixed

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecURLSpan.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class AztecURLSpan : URLSpan, IAztecInlineSpan {
3131
override var attributes: AztecAttributes = AztecAttributes()
3232

3333
constructor(url: String, attributes: AztecAttributes = AztecAttributes()) : super(url) {
34-
if (attributes.isEmpty()) {
34+
this.attributes = attributes
35+
36+
if (!this.attributes.hasAttribute("href")) {
3537
this.attributes.setValue("href", url)
36-
} else {
37-
this.attributes = attributes
3838
}
3939
}
4040

0 commit comments

Comments
 (0)