!if $base=1
 factor_html=1
 !exit
!endif

!if $maxima_factor=yes
 factor_html=!htmlmath $factor
 ftest=!replace * by , in $factor
 fn=!itemcnt $ftest
 myn=NaN
 !exit
!endif

!!par=(
!!!if $par isin $factor and $mupad_factor!=yes
!! factor_html=$factor
!! !exit
!!!endif

factor_html=
myn=!eval $base
factor=!translate ; to $\
$ in $factor
factor=!trim $factor
fn=!linecnt $factor
t=1
!if $myn != NaN
 !for k from 1 to $fn
  ii=!line $k of $factor
  checking=!item 1 of $ii
  power=!item 2 of $ii
  !read primecheck.proc
  base=$out
  !if $t>1
    factor_html=$factor_html <font color=green>&times;</font>
  !endif
  factor_html=$factor_html $base
  !ifval $power != 1
    factor_html=$factor_html<sup>$power</sup>
  !endif
  t=!eval $t+1
 !next k
!else
 !if $content != 1
  !if / isin $content
   factor_html=($content)
  !else
   factor_html=$content
  !endif
 !endif
 !for k from 1 to $fn
  ii=!line $k of $factor
  base=!item 1 to -2 of $ii
  base=!htmlmath $base
  power=!item -1 of $ii
  factor_html=$factor_html ($base)
  !ifval $power != 1
    factor_html=$factor_html<sup>$power</sup>
  !endif
  !advance t
 !next k
!endif 

