diff --git a/ReactNativeClient/lib/components/screens/note.js b/ReactNativeClient/lib/components/screens/note.js index be7c569aa1..7126c3649b 100644 --- a/ReactNativeClient/lib/components/screens/note.js +++ b/ReactNativeClient/lib/components/screens/note.js @@ -1,11 +1,12 @@ import React, { Component } from 'react'; -import { View, Button, TextInput } from 'react-native'; +import { View, Button, TextInput, WebView } from 'react-native'; import { connect } from 'react-redux' import { Log } from 'lib/log.js' import { Note } from 'lib/models/note.js' import { ScreenHeader } from 'lib/components/screen-header.js'; import { Checkbox } from 'lib/components/checkbox.js' import { _ } from 'lib/locale.js'; +import marked from 'lib/marked.js'; class NoteScreenComponent extends React.Component { @@ -15,7 +16,10 @@ class NoteScreenComponent extends React.Component { constructor() { super(); - this.state = { note: Note.new() } + this.state = { + note: Note.new(), + mode: 'view', + } } componentWillMount() { @@ -79,13 +83,29 @@ class NoteScreenComponent extends React.Component { ); } + let bodyComponent = null; + if (this.state.mode == 'view') { + const source = { + html: note ? marked(note.body, { gfm: true, breaks: true }) : '', + }; + + bodyComponent = ( + + +