Skip to content

Unexpected behavior with strings containing ampersand character & #686

@Tobi696

Description

@Tobi696

Decision Table

  • My issue does not look like “The HTML attribute 'xxx' is ignored” (unless we claim support for it)
  • My issue does not look like “The HTML element <yyy> is not rendered”

Good Faith Declaration

Description

I have noticed a strange behaviour that probably originates from the library trying to parse special characters in html (&, &lquote, ....), but failing to do so.

// Fails
<RenderHTML source={{ html: "&amp;" }} />

// Works
<RenderHTML source={{ html: "&" }} />

// Fails
<RenderHTML source={{ html: "& " }} />

// Works
<RenderHTML source={{ html: " &" }} />
```

### React Native Information

```sh
don't know what to provide here
```

### RNRH Version

6.3.4

### Tested Platforms

- [ ] Android
- [x] iOS
- [ ] Web
- [ ] MacOS
- [ ] Windows

### Reproduction Platforms

- [ ] Android
- [x] iOS
- [ ] Web
- [ ] MacOS
- [ ] Windows

### Minimal, Reproducible Example

// Fails
<RenderHTML source={{ html: "&" }} />

// Works
<RenderHTML source={{ html: "&" }} />

// Fails
<RenderHTML source={{ html: "& " }} />

// Works
<RenderHTML source={{ html: " &" }} />


### Additional Notes

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCrush'em all.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions