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:
johnnyq
2026-11-29 00:48:15 -05:00
parent a84c3eca79
commit 8b4fa5a1a0
484 changed files with 43707 additions and 63 deletions

View File

@@ -0,0 +1,28 @@
<?php
/*
* ITFlow - Database update to version 4.2.3 (from 4.2.2)
* Included by admin/database_updates.php - do not access directly
*
* Documents written in Markdown (functions/markdown.php):
* documents.document_markdown - what a Markdown document says, as it was written; NULL for a
* document written in the rich text editor. document_content stays the HTML every page
* shows, rendered from it each time it is saved
* document_versions.document_version_markdown - the same, for each earlier version
*
* Re-runnable: each column is added only where it isn't there.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_markdown_columns = [
['documents', 'document_markdown', "longtext DEFAULT NULL AFTER `document_content_raw`"],
['document_versions', 'document_version_markdown', "longtext DEFAULT NULL AFTER `document_version_content`"],
];
foreach ($itflow_markdown_columns as [$itflow_table, $itflow_column, $itflow_definition]) {
$itflow_column_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$itflow_table' AND COLUMN_NAME = '$itflow_column' LIMIT 1");
if (!$itflow_column_exists || mysqli_num_rows($itflow_column_exists) === 0) {
mysqli_query($mysqli, "ALTER TABLE `$itflow_table` ADD `$itflow_column` $itflow_definition");
}
}