Shell script of "qlmanage -p" generate error on html file in applescript

Please accept my apology in advance. I am just a beginner in Applescript and shell script so I am not even sure whether I am asking the right question.

I have one shell script in Applescript running in SD. Basically, I want to preview a file before I act on it.

 do shell script "qlmanage -p " & quoted form of (path of theDoc as string) 

the variable theDoc is a POSIX path to a file.
The code works for every text or pdf files. When it comes to every html files, I get the spinning beachball in SD and after a few seconds, MacOS (10.14.6) generate a crash report. Running the same script in Script Editor has the same situation.

I try using quicklook to view the same set of files in Finder and there is no problem at all.

I am wondering if this is a Mojave bug or my code?

Thank you very much in advance.

It’s not your code (although I suspect you mean POSIX path of) – qlmanage is crashing badly (“The command terminated due to receipt of a signal”). Not much you can do about that, other than report it to Apple.

Thank you very much again!