mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 00:59:03 +00:00
Documents in Markdown: a document can be written in Markdown with Write and Preview or in the rich text editor and switched either way, pictures pasted or dropped into the Markdown are kept as files, New Document starts in the way last used, Import Markdown Files beside Upload makes a document from each .md file, a Markdown button beside PDF downloads a document as a .md file, and Markdown pasted into a document's rich text editor goes in as formatting; versions, restore, copy and the API carry the Markdown, and the API's document create and update no longer escape values twice; database 4.2.3 adds documents.document_markdown and document_versions.document_version_markdown, and league/commonmark 2.10 and league/html-to-markdown 5.2 are added to libs/vendor through composer; 26.12.3 changelog entries
This commit is contained in:
@@ -27,6 +27,8 @@ $document_form_mode = 'add';
|
||||
$document_name = $document_description = $document_content = '';
|
||||
$document_folder_id = folderOwnedId($_GET['folder_id'] ?? 0, $client_id);
|
||||
$document_client_visible = 0;
|
||||
$document_markdown = null;
|
||||
$document_format_remember = true; // starts in the way the agent wrote last (js/document_markdown.js)
|
||||
// Drafted by AI when a model is set up for documentation and the role may use AI
|
||||
$ai_draft = aiReady('Documentation');
|
||||
|
||||
@@ -122,6 +124,13 @@ ob_start();
|
||||
if (description.value.trim() === '' && answer.description) {
|
||||
description.value = answer.description;
|
||||
}
|
||||
// Written in Markdown - the draft goes in as Markdown
|
||||
if (window.itflowDocumentFormat && itflowDocumentFormat.isMarkdown(form)) {
|
||||
return itflowDocumentFormat.putHtml(form, answer.html).then(function () {
|
||||
say('success', 'Drafted by AI - check it and fill in what is in [square brackets].');
|
||||
said.setAttribute('data-ai-document-drafted', '');
|
||||
});
|
||||
}
|
||||
var editor = window.tinymce ? tinymce.get().filter(function (ed) { return ed.getElement() === textarea; })[0] : null;
|
||||
if (editor) {
|
||||
editor.undoManager.add();
|
||||
|
||||
Reference in New Issue
Block a user