mirror of
https://github.com/FliegendeWurst/telegram_notes_bot.git
synced 2024-12-03 15:34:06 +00:00
Properly format newlines of plain text ICS entries
This commit is contained in:
parent
a1371b2948
commit
974d544db8
@ -32,9 +32,9 @@ const targetTemplate = await api.currentNote.getRelationValue('targetTemplate');
|
||||
const options = {
|
||||
"parentNoteId": dayNote.noteId,
|
||||
"title": name,
|
||||
"content": summaryHtml != "" ? summaryHtml : summary,
|
||||
"content": summaryHtml != "" ? summaryHtml : summary.replace(/\n/g, "<br>").replace(/\r/g, ""),
|
||||
"type": "text",
|
||||
"mime": summaryHtml != "" ? "text/html" : "text/plain"
|
||||
"mime": "text/html"
|
||||
};
|
||||
const resp = await api.createNewNote(options);
|
||||
const note = resp.note;
|
||||
|
@ -142,8 +142,8 @@ async fn process_one(update: Update, context: &mut Context) -> Result<(), Error>
|
||||
if CLIENT.get(&trilium_url("/custom/new_event")).form(&json!({
|
||||
"uid": calendar.events[0].uid,
|
||||
"name": calendar.events[0].summary,
|
||||
"summary": calendar.events[0].description,
|
||||
"summaryHtml": calendar.events[0].description_html.as_deref().unwrap_or_default(),
|
||||
"summary": calendar.events[0].description.replace("\\n", "\n"),
|
||||
"summaryHtml": calendar.events[0].description_html.as_deref().map(|x| x.replace("\\n", "\n")).unwrap_or_default(),
|
||||
"fileName": document.file_name,
|
||||
"fileData": text,
|
||||
"location": calendar.events[0].location,
|
||||
|
Loading…
Reference in New Issue
Block a user