* Since the code is suggesting using only $ - $ for inline, $$ - $$ for block math syntax,
specific delimiter for $ - $ and $$ - $$ is required, not general escape logic.
also it will fix the issue #2.
* Some code optimization and variable name change was done.
* I found that 'throwOnError:false' option doesn't actually work on katex. They will still throw an error if the syntax is invalid.
So instead of sending this directly, I fixed this code to catch the error internally, return the original latex token, and log it on the console when throwOnError option is explicitly set to true.