You can do this with the TexInsert plugin
Create an HTML macro with parameters, such as this, for instance:
internalLink_HTML <a href="/ckedit/doku.php?id=%1" class="wikilink1">%2</a>
The first parameter is the dokuwiki page id, the second is the text which you want to display for the link. Then in your page you would use the following markup:
This will give you a valid internal link.