Does a filename in Ubuntu starting with "readme" automatically become a readme document type?

html and scripts are also plain text so the file type hasn't changed, just weird mojo about subclass icon decisions,

I found something that may help you:

Save the following as jsp.xml:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/x-jsp">
    <comment>JSP file</comment>
    <glob pattern="*.jsp"/>
  </mime-type>
</mime-info>

Then open a terminal and run

xdg-mime install --novendor jsp.xml

Now all files with the extension .jsp should have the MIME type text/x-jsp.

See Shared MIME-info Database if you want to learn more about how MIME types are defined.