Как убрать пробелы из html-контента в реагировать на натив? - PullRequest
0 голосов
/ 18 декабря 2018

В моем проекте я загружаю html-контент, используя WebView реагировать нативно. Но проблема в том, что я получаю нежелательные символы в результате.реагировать на нативный как некоторые нежелательные символы вместе с текстом. Я пытался regex удалить это, но не работает. Следующий код - пожалуйста, помогите.

код

<Content contentContainerStyle={{ flex: 1}}>
     {this.state.data.map(item =>
       <View style={{flex:1,padding:10}}>
        <Text style={{textAlign:'center', margin:15,fontSize:20,fontWeight:'bold'}}>{item.data.course.name}</Text>
        <WebView
        source={{ html: item.data.description.replace(/^\s*&nbsp;/m, '') + htmlStyle }}
        javaScriptEnabled={true}
         />
         </View>
         )}
      </Content>

Ниже приведен скриншот

enter image description here

json

data:
course: {id: 5506, name: "Balance of Payment Account: Meaning and Significance"}
curriculum: false
description: "<p style="text-align: justify;"><strong>Guide to the module: </strong></p>↵<p style="text-align: justify;">              This module deals with the balance of payment account concepts from the Indian context. At the later part, a typical balance of payment scenario of India is illustrated by taking 2012-13 financial year as an example.</p>↵<p style="text-align: justify;"><strong>Balance of payment account</strong></p>↵<p style="text-align: justify;">           Balance of payment systematically shows the whole types of economic engagement between residents of India and the residents of the rest of the world. The transaction details are usually shown for a period (like one year). 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...