I'm using tex4ht for conversion of heavily maths loaded LaTeX files into HTML to be able to serve them in a web app. Can successfully convert all equations to MathML and jsMath. But as equations are not web optimized, some of them are rendered wrongly or dont even get rendered as they are in original PDF's. So I decided to use maths as LaTeX as I think Mathjax can handle LaTeX equations better than jsMath or MathML.
Have already seen tex4ht leaving equations unchanged, tex4ht leaving equations unchanged - including \[...\] and \(...\) and TeX4HT Equation unchanged with newcommand or def command
I can manage to leave inline maths as they are but struggling with aligned standalone maths.
For example:
After a time $t$, the ground state $\ket{g}$ and the excited state $\ket{e}$ will each have accumulated a phase that is proportional to their energies:
\begin{align}
\ket{\psi(0)} \to \ket{\psi(t)} = \frac{e^{-iE_1 t/\hbar}}{\sqrt{2}} \ket{g} + \frac{e^{-iE_2 t/\hbar}}{\sqrt{2}} \ket{e}\, .
\end{align}
We can take out the factor $e^{-iE_1 t/\hbar}$ as a global unobservable phase, and obtain
\begin{align}\label{eq:atomequator}
\ket{\psi(t)} = \frac{1}{\sqrt{2}} \ket{g} + \frac{e^{-i(E_2 - E_1)t/\hbar}}{\sqrt{2}} \ket{e}\, .
\end{align}
So I can get tex4ht not to convert $\ket{g}$ in first line into image but having issues with maths within {align}.
I'm using michal-h21's .cfg file described in this answer: https://tex.stackexchange.com/a/165119/52068
any help would be greatly appreciated.
PS: I'm not a LaTeX expert and did not write the documents myself. So I somehow need to find a way to workout the LaTeX I have without modifying or with minimum amount of modification.

along with $(q(t), p(t))$ inline equations in same LaTeX. I've tried to add \def\AltMath2#1${\eqtoks{$$#1$$}% \HCode{\the\eqtoks}$} \Configure{$$}{}{}{\expandafter\AltMath2} into configuration file but no luck. Thanks in advance for your help
– tarikakyol Jun 23 '14 at 11:27%) in your answer that needs to be fixed as:\HCode{\the\eqtoks}$$}– tarikakyol Jun 23 '14 at 15:07\captioncommand with equation inside figure and it compiled correctly – michal.h21 Jul 09 '14 at 12:50\ref{eq:labelname}for referencing equations? if yes, it should be doable without breaking support for other types of references (ie. for sections, which aren't supported by mathjax. maybe post this as new question – michal.h21 Jul 15 '14 at 11:05MathJax.Hub.Config({block. Should the brace pair followingTeX:encase theextensionsas well? (but nottex2jax?) – alex.jordan Oct 04 '14 at 19:57mathjaxbut I think it shouldn't enclose extensions – michal.h21 Oct 04 '14 at 20:33extensionsinside theTexblock, a lot more wasn't working. I think that this indicates it should be encased. – alex.jordan Oct 05 '14 at 01:43tex2jax. extensions used inside ofTeXblock will load extensions for LaTeX macro support – michal.h21 Oct 05 '14 at 08:51