mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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>.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user