-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ability to set new line on message using \n and user's messages are n…
…ow also formatted
- Loading branch information
1 parent
ecc92f2
commit 2a9b692
Showing
2 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
component/src/views/chat/messages/remarkable/remarkableUtils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export class RemarkableUtils { | ||
// this is to allow remarkable to render \n as a new line: | ||
// it operates by replacing \n with \n\n | ||
public static replaceNewlineWithDouble(str: string) { | ||
return str.replace(/(?<!\n)\n(?!\n)/g, '\n\n'); | ||
} | ||
} |