fix: disable anchor default behavior (#1857)

* fix: prevent anchor link default behavior (in mdx dictionary)
This commit is contained in:
xiaoyifang 2024-10-24 21:05:59 +08:00 committed by GitHub
parent 047f725858
commit e749a6077f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -920,8 +920,8 @@ void MdxDictionary::replaceLinks( QString & id, QString & article )
QRegularExpressionMatch match = RX::Mdx::audioRe.match( newLink ); QRegularExpressionMatch match = RX::Mdx::audioRe.match( newLink );
if ( match.hasMatch() ) { if ( match.hasMatch() ) {
// sounds and audio link script // sounds and audio link script
QString newTxt = QString newTxt = match.captured( 1 ) + match.captured( 2 ) + "gdau://" + id + "/" + match.captured( 3 )
match.captured( 1 ) + match.captured( 2 ) + "gdau://" + id + "/" + match.captured( 3 ) + match.captured( 2 ); + match.captured( 2 ) + R"( onclick="return false;" )";
newLink = newLink =
QString::fromUtf8( QString::fromUtf8(
addAudioLink( "\"gdau://" + getId() + "/" + match.captured( 3 ).toUtf8().data() + "\"", getId() ).c_str() ) addAudioLink( "\"gdau://" + getId() + "/" + match.captured( 3 ).toUtf8().data() + "\"", getId() ).c_str() )