correctly parse BRs
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { MATRIXTO_URL_PATTERN } from '../linkify-matrix';
|
import { MATRIXTO_URL_PATTERN } from '../linkify-matrix';
|
||||||
import { PlainPart, UserPillPart, RoomPillPart } from "./parts";
|
import { PlainPart, UserPillPart, RoomPillPart, NewlinePart } from "./parts";
|
||||||
|
|
||||||
function parseHtmlMessage(html) {
|
function parseHtmlMessage(html) {
|
||||||
const REGEX_MATRIXTO = new RegExp(MATRIXTO_URL_PATTERN);
|
const REGEX_MATRIXTO = new RegExp(MATRIXTO_URL_PATTERN);
|
||||||
@@ -42,6 +42,8 @@ function parseHtmlMessage(html) {
|
|||||||
default: return new PlainPart(n.textContent);
|
default: return new PlainPart(n.textContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case "BR":
|
||||||
|
return new NewlinePart("\n");
|
||||||
default:
|
default:
|
||||||
return new PlainPart(n.textContent);
|
return new PlainPart(n.textContent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user