giterlizzi / dokuwiki-plugin-datatables

Add DataTables support to DokuWiki
GNU General Public License v2.0
10 stars 11 forks source link

Format data- attributes with ' single quotes #9

Closed ghybs closed 8 years ago

ghybs commented 8 years ago

Hi,

Following issue #7, this modification makes it possible to use double quotes " in value of data- attributes, so that they can be passed to DataTables JavaScript through jQuery (see also https://datatables.net/manual/options).

It simply reverses the use of single quotes ' (which are now used to delimit the value of the attribute) and double quotes " (which are now used to delimit the string first argument of sprintf function call).

Furthermore, it also escapes (html entity) any extra single quote ' that may be used in the attribute value. With the previous code, any quote is passed as-is and breaks the xml syntax.