Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken newline functionality for markdown #464

Merged
merged 8 commits into from
Oct 13, 2023
7 changes: 6 additions & 1 deletion src/components/common/SizedMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class SizedMarkdown extends Component {
})
}

// Fixes: https://github.com/zooniverse/mobile/issues/412
addLineBreak(content) {
return content.replace(/\n/g, (n) => n + n);
}

render() {
const { viewDimensions } = this.state

Expand Down Expand Up @@ -77,7 +82,7 @@ class SizedMarkdown extends Component {
return (
<View onLayout={this.onViewLayout}>
<Markdown rules={markdownImageRule} styles={customStyles}>
{ this.props.children }
{this.addLineBreak(this.props.children)}
</Markdown>
</View>
)
Expand Down