Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Regular .txt files #11

Closed
Aurocosh opened this issue Nov 25, 2022 · 5 comments
Closed

Regular .txt files #11

Aurocosh opened this issue Nov 25, 2022 · 5 comments

Comments

@Aurocosh
Copy link

Hello. For some reason this plugin doesn't work with regular .txt files. It works with all other extensions that i tested. Furthermore .txt extension gets deleted from plugin options whenever i leave them. It doesn't work even with "Destroy other plugins" options turned on.

Is this a bug? Or is .txt not supported for some kind of technical reason?

Just in case here is the current list of my plugins: Advanced Tables, Obsidian Git, Plaintext, Tasks.

@valgameiroconsulting
Copy link

I have a similar problem. I'm on Windows 10 and Ubuntu 22.04 LTS, and every time I try to open a .txt file it opens up in my text editor, not Obsidian. If I change the extension to .text it works, but .txt does not. It clears it out of the setting field even.

@hacks2learn
Copy link

I discovered the same problem in Linux but I found a workaround:

Solution: Update the file : .obsidian/plugins/obsidian-plaintext/main.js
Comment out the line : ["txt-as-md-obsidian", "txt"], using //
As follows

/**
 * Maps pluginIds to extensions that they use.
 * These extensions will be filtered out by default.
 *
 * @version 0.2.0
 * @author dbarenholz
 * @since 2022/08/13
 */
const otherExts = new Map([
    // https://github.com/deathau/cooklang-obsidian
    ["cooklang-obsidian", "cook"],
    // https://github.com/deathau/csv-obsidian
    ["csv-obsidian", "csv"],
    // https://github.com/caronchen/obsidian-chartsview-plugin
    ["obsidian-chartsview-plugin", "csv"],
    // https://github.com/Darakah/obsidian-fountain
    ["obsidian-fountain", "fountain"],
    // https://github.com/deathau/ini-obsidian
    ["ini-obsidian", "ini"],
    // https://github.com/deathau/txt-as-md-obsidian
    //["txt-as-md-obsidian", "txt"],
    // https://github.com/mkozhukharenko/mdx-as-md-obsidian
    ["mdx-as-md-obsidian", "mdx"],
    // https://github.com/ryanpcmcquen/obsidian-org-mode
    ["obsidian-org-mode", "org"],
    // https://github.com/tgrosinger/ledger-obsidian
    ["ledger-obsidian", "ledger"],
    // https://github.com/zsviczian/obsidian-excalidraw-plugin
    ["obsidian-excalidraw-plugin", "excalidraw"],
]);

Works great now for plain old txt files :)

@dbarenholz
Copy link
Owner

Fixed in new version - I got the checking logic wrong because I was not familiar with JS maps - oops!

@valgameiroconsulting
Copy link

valgameiroconsulting commented Jun 9, 2023

I'm on Windows 10, and just updated the plugin to the latest version and restarted Obsidian. When I click a .text file it lets me open up and edit, but when I click a .txt file it opens up my default text editor. If I add txt to the list of extensions, it no longer opens up notepad, but it doesn't let me edit the .txt file.

@dbarenholz
Copy link
Owner

I'm on Windows 10, and just updated the plugin to the latest version and restarted Obsidian. When I click a .text file it lets me open up and edit, but when I click a .txt file it opens up my default text editor. If I add txt to the list of extensions, it no longer opens up notepad, but it doesn't let me edit the .txt file.

@valgameiroconsulting Please make sure you have the latest version (right now, 0.3.0) and that it is enabled:
image
And, make sure that in the settings you have the extension you wish to edit. I believe in your case this would be .txt and .text?
image
After doing so, you should see a notice (pop-up) in the top-right of your screen that shows the extensions have indeed been updated.
image

If all that works as I have described, then I don't know what the problem is. I can edit just fine?
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants