Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.12.3 WikiText bug: spaces not replaced with underscores in filename #2362

Closed
bruvellu opened this issue Jul 23, 2024 · 0 comments · Fixed by #2370
Closed

v2.12.3 WikiText bug: spaces not replaced with underscores in filename #2362

bruvellu opened this issue Jul 23, 2024 · 0 comments · Fixed by #2370
Assignees
Labels
Milestone

Comments

@bruvellu
Copy link

IMPORTANT

  • Package: net.gsantner.markor
  • Version: v2.12.3 (152) (Sorry, I couldn't test the latest commits on the master branch).
  • Flavor: Gplay (release)
  • Build date: 2024-07-20T14:14Z
  • ISource: Google Play
  • VCS Hash: 275f488
  • VCS Msg: Markor v2.12.3 (152)
  • I accept that this issue will be closed without further notice in case I didn't describe the problem including general information, or didn't search for similar issues & requests.

Explain the Problem

When creating a new Wikitext/Zim file with a title that contains whitespaces, the spaces are not replaced by underscores in the filename. But Zim does not support spaces in filenames.

For example, creating a new file with a title This is a new file makes a file named This is a new file.txt instead of This_is_a_new_file.txt.

This used to work on v2.12.0, but stopped after the updates to the NewFileDialog a few months ago (f35383a). I believe the relevant code was this one:

private String getFileNameWithoutExtension(String typedFilename, int selectedTemplatePos) {
    if (selectedTemplatePos == 7) {
        // Wikitext files always use underscores instead of spaces
        return typedFilename.trim().replace(' ', '_');
    }
    return typedFilename.trim();
}

Steps to Reproduce

  1. Click on the big red button with a +
  2. Write a title with spaces "This is a title"
  3. Select .txt extension, Wikitext / Zim type, and zim-wiki-empty.txt template
  4. Click OK

Praise

Thank you so much! As a Zim enthusiast and heavy user, Markor has been a game-changer for my mobile note-taking.

@gsantner gsantner added the bug label Jul 23, 2024
@gsantner gsantner changed the title Wikitext/Zim: spaces not replaced with underscores in filename v2.12.3 Wikitext/Zim: spaces not replaced with underscores in filename Jul 23, 2024
@gsantner gsantner changed the title v2.12.3 Wikitext/Zim: spaces not replaced with underscores in filename v2.12.3 WikiText bug: spaces not replaced with underscores in filename Jul 23, 2024
gsantner pushed a commit that referenced this issue Jul 27, 2024
…kitext newfile #2362, virtual directory browser #2350) (PR #2370 by @hardhard1)

* Jump by a line identifier, not by id
* For all nodes, use eval
* Fixed bad key in snippet directory setting
* Fix virtual folders and wikitext underscores
@gsantner gsantner added this to the Markor v2.13 milestone Jul 27, 2024
elyahw pushed a commit to writing-tools/marelias-notepad that referenced this issue Sep 26, 2024
…santner#2369, wikitext newfile gsantner#2362, virtual directory browser gsantner#2350) (PR gsantner#2370 by @hardhard1)

* Jump by a line identifier, not by id
* For all nodes, use eval
* Fixed bad key in snippet directory setting
* Fix virtual folders and wikitext underscores

(cherry picked from commit 57aaf0f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants