eclipsesource / eclipsesource/tabris-js

With TexView.markupEnabled the "\n" and "<br />" are rendered at the same time

Open
#1,425 1 comment 0 reactions 0 assignees View on GitHub
bug windows
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description

Setting `markupEnabled` on a `TextView` renders `
` but also treats regular line breaks (`\n`) as new lines. This can be observed in the [bookstore demo](https://github.com/eclipsesource/tabris-js/blob/master/examples/bookstore/AboutPage.js#L7).

#### iOS

![image uploaded from ios 6](https://user-images.githubusercontent.com/73655/28113631-92763a4c-66fd-11e7-8326-c0dce1927d39.jpg)

#### Windows

![image](https://user-images.githubusercontent.com/73655/28113647-a108f806-66fd-11e7-91e4-b9cee3f32283.png)

### Expected behavior

The `TextView` should only render the
tags and not the line breaks. The following html in the browser yields the expected results:

```html

Authors of book covers:

Paula Rodriguez - 1984
Marc Storrs and Rob Morphy - Na Tropie Nieznanych

Cat Finnie - Stary Czlowiek I Morze

Andrew Brozyna - Hobbit

Viacheslav Vystupov - Wojna Swiatow

Marc Storrs and Rob Morphy - Zegar Pomaranczowy Pracz

Andrew Evan Harner - Ksiega Dzungli`;

```

![image](https://user-images.githubusercontent.com/73655/28113712-fb5a6600-66fd-11e7-98dd-36b18a90b499.png)

### Environment

- Tabris.js version: `nightly`
- Device: iPhone SE, Windows 10 Desktop
- OS: iOS 10.3.2, Windows 10

### Code snippet

See bookstore example.
```javascript
const ATTRIBUTION_TEXT =
`Authors of book covers:

Paula Rodriguez - 1984
Marc Storrs and Rob Morphy - Na Tropie Nieznanych

Cat Finnie - Stary Czlowiek I Morze

Andrew Brozyna - Hobbit

Viacheslav Vystupov - Wojna Swiatow

Marc Storrs and Rob Morphy - Zegar Pomaranczowy Pracz

Andrew Evan Harner - Ksiega Dzungli`;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.