Version: 2.4-GIT (using KDE 4.6.0) OS: Linux TabsEngine displays the text from ultimate-guitar.com between the <pre>...</pre> tags in a browser. Thus, multiple spaces are reduced to one space which yields chords like Bm F# On a dark desert highway, cool wind in my hair (the F# chord should be over "cool") Solution: the <pre> tag should be added. Patch is attached. Reproducible: Always
Created attachment 57196 [details] Adds the <pre> tag.
Thank you for the patch. Please submit it to http://git.reviewboard.kde.org, you need to get an identity at http://identity.kde.org first.
commit 43c3d86dd856a43aa82d567c365c0c4610989673 Author: Rainer Sigle <rainer.sigle@web.de> Date: Sat Feb 19 13:25:28 2011 +0100 Do not remove HTML <pre> and </pre>-tags from tabs-data. Fix for bug 266171. Thanks to Martin Kunkel for pointing this out! diff --git a/src/context/engines/tabs/TabsEngine.cpp b/src/context/engines/tabs/TabsEngine.cpp index 7c893c6..24507c0 100644 --- a/src/context/engines/tabs/TabsEngine.cpp +++ b/src/context/engines/tabs/TabsEngine.cpp @@ -326,8 +326,12 @@ TabsEngine::resultUltimateGuitarTab( const KUrl &url, QByteArray data, NetworkAc else result = QString( data ); + // extract tab title and data const QString title = subStringBetween( result, "<strong>", "</strong>"); - QString tabs = subStringBetween( result, "<pre>", "</pre>" ); + QRegExp regex = QRegExp( "<pre>.*</pre>", Qt::CaseInsensitive ); + if( regex.indexIn( result ) == -1 ) + return; + QString tabs = regex.cap(); tabs.remove( "<span>", Qt::CaseInsensitive ); tabs.remove( "</span>", Qt::CaseInsensitive ); @@ -441,8 +445,12 @@ TabsEngine::resultFretplayTab( const KUrl &url, QByteArray data, NetworkAccessMa else result = QString( data ); + // extract tab title and data QString title = subStringBetween( result, "title\" content=\"", ". Accurate and free" ); - QString tabs = subStringBetween( result, "<pre>", "</pre>" ); + QRegExp regex = QRegExp( "<pre>.*</pre>", Qt::CaseInsensitive ); + if( regex.indexIn( result ) == -1 ) + return; + QString tabs = regex.cap(); tabs.remove( "<span>", Qt::CaseInsensitive ); tabs.remove( "</span>", Qt::CaseInsensitive );
Rainer, to close bugs automatically, please add a new line below your git comment that says BUG: 266171 else we have to close it manually.