富文本内有英文,换行的时候怎么保证英文不被切断

local xml_str = 1. After the event starts, some quests will be available for 8 days at most.

2. If you complete all of the objectives, you will receive full rewards. If not, you will be rewarded according to your progress.

3. Each player can claim the full rewards only once when completing all of the objectives.

local rt = pc,PCRichText:create()
rt:setContentSize(cc.size(200,150))
rt:setContent(xml_str)

这样处理完的富文本,换行的时候 末尾的英文单词会被切断

请问如何保证末尾的单词不被切断

1,检测空格,如果空格后的单词与下个空格之间的长度大于你设定的长度那就换行。
2,检测首字母大写,如果大写字母后的单词长度大于设定长度那就换行。