ganesshkumar / obsidian-excel-to-markdown-table

An Obsidian plugin to paste data from Microsoft Excel, Google Sheets, Apple Numbers and LibreOffice Calc as Markdown tables in Obsidian editor.
MIT License
199 stars 7 forks source link

[BUG] #10

Open koldex opened 2 years ago

koldex commented 2 years ago

Describe the bug This plugin gives an error and fails to load on Obsidian for iOS

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

ganesshkumar commented 2 years ago

Thanks for reporting the issue. Can you please share the error message that you get when you try to install the plugin?

Get Outlook for Androidhttps://aka.ms/ghei36


From: koldex @.> Sent: Wednesday, February 23, 2022 10:57:18 AM To: ganesshkumar/obsidian-excel-to-markdown-table @.> Cc: Ganessh Kumar @.>; Assign @.> Subject: [ganesshkumar/obsidian-excel-to-markdown-table] [BUG] (Issue #10)

Describe the bug This plugin gives an error and fails to load on Obsidian for iOS

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

— Reply to this email directly, view it on GitHubhttps://github.com/ganesshkumar/obsidian-excel-to-markdown-table/issues/10, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAQJIMPSDDRNEIBOWTV3EPDU4RV3NANCNFSM5PDK2U2Q. You are receiving this because you were assigned.Message ID: @.***>

marcusmoore commented 2 years ago

Hi!

I ran into the same issue on iOS 15.4.1 (tested on iPad and iPhone)

The error message displayed at the bottom of the screen is Failed to load plugin obsidian-excel-to-markdown-table.

Is there any way to get more information that would be helpful?

Thanks!

Edit: I updated the error message. I missed part of it the first time.

marcusmoore commented 2 years ago

I was able to get a console log from iOS via the obsidian-mobile-logging plugin.

Here is what is logged when trying to enable the plugin:

[error] Plugin failure: obsidian-excel-to-markdown-table SyntaxError: Invalid regular expression: invalid group specifier name
marcusmoore commented 2 years ago

I was issue-diving other repos and this comment caught my eye which says that regex lookbehinds aren't supported in iOS.

Could this line be the issue: https://github.com/ganesshkumar/obsidian-excel-to-markdown-table/blob/2b1de6275e0ec3ff910cfe90da9c116a7eea3dcb/src/excel-markdown-helpers.ts#L16

ganesshkumar commented 2 years ago

Open an issue in the upstream dependency package, https://github.com/csholmq/vscode-excel-to-markdown-table/issues/28

adambkovacs commented 1 year ago

When I was looking for an easy way to paste tables, @ganesshkumar your plugin looked like the perfect solution 🙂 But if looks like I have the same issue

When I try to enable the installed plugin I get the following error:

Failed to load plugin obsidian-excel-to-markdown-table
Galacsh commented 1 year ago

Thanks to @marcusmoore for figuring out it was about regex issue. Now I have no exception on my iPhone!

I've modified the positive lookbehind to negative lookahead, like this below.

https://github.com/ganesshkumar/obsidian-excel-to-markdown-table/blob/2b1de6275e0ec3ff910cfe90da9c116a7eea3dcb/src/excel-markdown-helpers.ts#L16

to

// .obsidian/plugins/obsidian-excel-to-markdown-table/main.js#L104
var EXCEL_NEWLINE_ESCAPED_CELL_REGEX = /"([^\t]*(?!\r)\n[^\t]*)"/g;

Not sure that this regex is enough to do its' all jobs, but works pretty well for me. :)

Galacsh commented 1 year ago

For those who doesn't need this plugin to work in IOS, just change isDesktopOnly to true.

// .obsidian/plugins/obsidian-excel-to-markdown-table/manifest.json
{
  "id": "obsidian-excel-to-markdown-table",
  "name": "Excel to Markdown Table",
  ...,
  "isDesktopOnly": true // <-- set to true
}