Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ENGINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Filee chooses engines automatically. Settings → *Engines* shows their status,
| PDFsharp | built in (library) | images → PDF (CMYK pictures stay CMYK), merge, split, page ranges, page organising, lossless rotate and crop-box edits, pages per sheet (N-up), spreadsheet print-studio assembly, **compression** (smaller PDFs, see below), PDFs without their metadata |
| PDFium | built in (library) | PDF → images (multi-page TIFF/GIF supported); CMYK pages → CMYK JPG/TIFF through Ghostscript when it is installed |
| Unhwp | built in (library) | HWP/HWPX → TXT, Markdown, HTML (pictures in a `<name>_files` folder next to the Markdown, embedded in the HTML) |
| Text & Markdown (Markdig) | built in (library) | **Markdown → HTML, TXT**; **TXT, LOG, PY, PAC, BAT, CMD, COMMAND, LUA, CSS, PS1, SQL, AHK, INI, RSC, C, H, CPP, CC, CXX, HPP, HH, HXX, CS, DART, HQL, DBML, JAVA, INO, PDE → UTF-8 TXT**, preserving source text without running scripts (and → PDF / DOCX through the HWPX writer, rhwp or LibreOffice) |
| Text & Markdown (Markdig) | built in (library) | **Markdown → HTML, TXT**; **TXT, LOG, CXLOG, PY, PAC, BAT, CMD, COMMAND, LUA, CSS, PS1, SQL, AHK, INI, RSC, C, H, CPP, CC, CXX, HPP, HH, HXX, CS, DART, HQL, DBML, JAVA, INO, PDE → UTF-8 TXT**, preserving source text without running scripts (and → PDF / DOCX through the HWPX writer, rhwp or LibreOffice) |
| Spreadsheets (ExcelDataReader for XLS) | built in (library) | **XLSX, XLS, ODS, CSV, TSV → XLSX, ODS, CSV, TSV** (one CSV / TSV per sheet) |
| Office Open XML | built in | **DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX, PPTM / POTX / POTM / PPSX ↔ PPTX** (macros removed for macro-free types) |
| Fonts | built in | **TTF, OTF, WOFF, WOFF2, EOT ↔ each other**; **FON (NE monochrome FNT v2/v3, supported single-byte charsets) → TTF, OTF, WOFF, WOFF2, EOT only**; CFF (PostScript) outlines become TrueType for TTF and EOT |
Expand Down
8 changes: 4 additions & 4 deletions src/Filee.Core/Formats/FormatRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ public static class FormatRegistry
new("sda", "SDA", FormatCategory.Presentation, ["sda", "sdd"], Writable: false),

// Plain text / markup
// Text logs, source code (Arduino and Processing sketches too), database schemas (DBML), proxy scripts, style sheets and settings files are read as plain
// text, never executed, compiled or translated (issues #273, #284, #254, #388, #368, #607, #536, #630, #661, #660,
// #864, #828, #980, #997, #854, #1176).
// Text logs (CrossOver's .cxlog too), source code (Arduino and Processing sketches too), database schemas (DBML), proxy
// scripts, style sheets and settings files are read as plain text, never executed, compiled or translated (issues
// #273, #284, #254, #388, #368, #607, #536, #630, #661, #660, #864, #828, #980, #997, #854, #1176, #1383).
new("txt", "TXT", FormatCategory.Text,
["txt", "log", "py", "pac", "bat", "cmd", "command", "lua", "css", "ps1", "sql", "ahk", "ini", "rsc",
["txt", "log", "cxlog", "py", "pac", "bat", "cmd", "command", "lua", "css", "ps1", "sql", "ahk", "ini", "rsc",
"c", "h", "cpp", "cc", "cxx", "hpp", "hh", "hxx", "cs", "dart", "hql", "dbml", "java", "ino", "pde"]),
new("md", "Markdown", FormatCategory.Text, ["md", "markdown"]),
new("html", "HTML", FormatCategory.Text, ["html", "htm", "xhtml"]),
Expand Down
2 changes: 1 addition & 1 deletion src/Filee.Core/Settings/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static bool IsFlipKeyAllowed(string key, IEnumerable<TriggerGesture> gest
public sealed class AppSettings
{
/// <summary>Current schema version. Increase when the format changes and add a migration.</summary>
public const int CurrentSchemaVersion = 98;
public const int CurrentSchemaVersion = 99;

public int SchemaVersion { get; set; } = CurrentSchemaVersion;

Expand Down
3 changes: 3 additions & 0 deletions src/Filee.Core/Settings/UserDataStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,9 @@ public static bool ApplyToLibrary(int from, List<Preset> presets, List<ToolbarPr
// v98: "VTF" (any picture to a Valve texture) joins the palette after HEIC, not a donut.
if (from < 98 && presets.All(p => p.Id != BuiltInData.VtfId))
changed |= AddLikeNewLibrary(presets, BuiltInData.VtfId);
// v99: CrossOver logs (.cxlog, #1383) learn the text donut; custom claims stay put.
if (from < 99)
changed |= LearnExtensions(profiles, out _, ["cxlog"]);
return changed;
}

Expand Down
27 changes: 26 additions & 1 deletion tests/Filee.Core.Tests/ScriptTextTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Lua, PowerShell, AutoHotkey and batch scripts, SQL and HiveQL, DBML database schemas, INI files, RouterOS exports, CSS
// style sheets, C, C++, C#, Dart and Java source files and Arduino / Processing sketches are plain text (issues #388, #368,
// #442, #607, #536, #630, #661, #660, #864, #828, #980, #997, #854, #1176): recognised, and learnt by existing text donuts.
// #442, #607, #536, #630, #661, #660, #864, #828, #980, #997, #854, #1176), and so are CrossOver logs (#1383): recognised, and
// learnt by existing text donuts.

using Filee.Core.Formats;
using Filee.Core.Presets;
Expand Down Expand Up @@ -36,6 +37,8 @@ public class ScriptTextTests
[InlineData("Legacy.JAVA")]
[InlineData("Blink.ino")]
[InlineData("OldSketch.PDE")]
[InlineData("Steam.cxlog")]
[InlineData("Wine.CXLOG")]
public void Scripts_and_style_sheets_are_text(string name) => Assert.Equal("txt", FormatRegistry.Detect(name)?.Id);

[Fact]
Expand Down Expand Up @@ -189,4 +192,26 @@ public void Version_86_text_donuts_learn_ino_and_pde_without_taking_custom_claim
Assert.False(SettingsMigrations.ApplyToLibrary(86, presets, profiles));
Assert.DoesNotContain("ino", text); // the user's own donut has it
}

[Fact]
public void A_crossover_log_uses_the_text_donut() =>
Assert.Equal("text", ProfileSelector.Select(BuiltInData.CreateProfiles(), ["Steam.cxlog"])?.Id);

[Fact]
public void Version_99_text_donuts_learn_cxlog_without_taking_custom_claims()
{
var presets = BuiltInData.CreatePresets();
var profiles = BuiltInData.CreateProfiles();
var text = profiles.Single(p => p.Id == "text").Extensions;
text.Remove("cxlog");

Assert.True(SettingsMigrations.ApplyToLibrary(98, presets, profiles));
Assert.Contains("cxlog", text);
Assert.False(SettingsMigrations.ApplyToLibrary(98, presets, profiles));

text.Remove("cxlog");
profiles.Insert(0, new ToolbarProfile { Id = "my-logs", Name = "Logs", Extensions = ["CXLOG"] });
Assert.False(SettingsMigrations.ApplyToLibrary(98, presets, profiles));
Assert.DoesNotContain("cxlog", text); // the user's own donut has it
}
}
Loading