'Using Brackets in MathJax - Tree Question

I have used LaTeX using different packages to make trees, e.g. using the format below. Is there a way to get a tree to run using MathJax using the code below? I have a bunch of trees that I coded using the exact format below, and I am wanting to get them online. What would I have to do for the program to recognize the 'forest'? Is there something minor that I could adjust to get it to work?

\begin{forest}
  for tree={l+=0.5cm} % increase level distance
  [,roof
    [1[2[3[4]][4[3]]][3[2[4]][4[2]]][4[2[3]][3[2]]]]
    [2[1[3[4]][4[3]]][3[1[4]][4[1]]][4[1[3]][3[1]]]]
    [3[1[2[4]][4[1]]][2[1[4]][4[1]]][4[1[2]][2[1]]]]
    [4[1[2[3]][3[2]]][2[1[3]][3[1]]][3[1[2]][2[1]]]]
  ]
\end{forest}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source