gd2md-html icon indicating copy to clipboard operation
gd2md-html copied to clipboard

Getting a new error wit the extension: TypeError: Cannot call method "replace" of null.

Open serferdinand2 opened this issue 1 year ago • 4 comments

When trying to convert doc to MD I get an error above. Never happened before. It happens in only one Doc file.

What could potentially be causing this?

serferdinand2 avatar Oct 22 '24 20:10 serferdinand2

Thanks for filing this bug. It appears to be happening very rarely (although there have been a number in the past week: about 100 times in more than 4 million executions), and it is related to the TOC in the Google Doc, which we use to create intra-doc hyperlinks.

So I am guessing that the doc in question contains some intra-doc links and that there is some problem where the heading ID or the URL is null. I can do some more null checking there.

I'm not sure if you can share view access to the Doc file where this occurs, but if so that would be great to have a reproducible bug.

evbacher avatar Oct 23 '24 00:10 evbacher

Not to necrobump the issue, but I am experiencing this as well. As @evbacher mentioned, the issue does appear to be with internal links. My intention is to convert a google doc into markdown for obsidian, so ideally I'd like to be able to customize how internal links are handled. Unfortunately it does not seem as though that is currently possible?

Soluna7 avatar Mar 18 '25 20:03 Soluna7

Can you share a Doc that causes this error? I only need view access -- I can make a copy and try to reproduce this and see what's causing it. I have not been able to reproduce it on my own yet.

If I do null checking, the links will just not work, which is probably not what you want.

evbacher avatar Mar 18 '25 20:03 evbacher

Thank you @evbacher - removing the TOC Table of Contents from my document solved this error for me 🙇‍♂

whyboris avatar May 23 '25 16:05 whyboris