1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Mobile: Fixes #902: Don't change existing note when sharing with mobile app

This commit is contained in:
Laurent Cozic
2018-10-24 19:10:05 +01:00
parent 739a6a4a9c
commit 2cb24bf198
2 changed files with 30 additions and 10 deletions

View File

@ -73,8 +73,12 @@ class Note extends BaseItem {
}
static defaultTitle(note) {
if (note.body && note.body.length) {
const lines = note.body.trim().split("\n");
return this.defaultTitleFromBody(note.body);
}
static defaultTitleFromBody(body) {
if (body && body.length) {
const lines = body.trim().split("\n");
let output = lines[0].trim();
// Remove the first #, *, etc.
while (output.length) {