Pass dict_path to dictionary fix_html_func (#7057)

That way images can be made to work in a more generic, portable manner, such as:

```
return function(html, dict_path)
    html = html:gsub('<rref[^>]*>([^<]*%.jpg)</rref>', '<img src="'..dict_path..'res/%1">')
    return html
end
```

Cf. <https://github.com/koreader/koreader/issues/6056>.
pull/7062/head
Frans de Jonge 3 years ago committed by GitHub
parent 4548ced866
commit b8bed49a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -577,7 +577,8 @@ local function tidyMarkup(results)
result.is_html = ifo.is_html
result.css = ifo.css
if ifo.fix_html_func then
local ok, fixed_definition = pcall(ifo.fix_html_func, result.definition)
local dict_path = util.splitFilePathName(ifo.file)
local ok, fixed_definition = pcall(ifo.fix_html_func, result.definition, dict_path)
if ok then
result.definition = fixed_definition
else

Loading…
Cancel
Save