Skip to content

Commit

Permalink
Fixing issues with images not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Oct 3, 2023
1 parent 491ac03 commit 06d2c4a
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,27 @@ public TextConverterBase() {
* @param webView The WebView content to be shown in
* @return Copy of converted html
*/
public String convertMarkupShowInWebView(Document document, String content, Activity context, WebView webView, boolean lightMode, boolean lineNum) {
public String convertMarkupShowInWebView(
final Document document,
final String content,
final Activity context,
final WebView webView,
final boolean lightMode,
final boolean lineNum
) {
String html;
try {
html = convertMarkup(content, context, lightMode, lineNum, document.getFile());
} catch (Exception e) {
html = "Please report at project issue tracker: " + e;
}

String baseFolder = document.getFile().getParent();
if (baseFolder == null) {
baseFolder = "file://" + baseFolder + "/";
String parent = document.getFile().getParent();
if (parent == null) {
parent = _appSettings.getNotebookDirectory().getAbsolutePath();
}
final String baseFolder = "file://" + parent + "/";

webView.loadDataWithBaseURL(baseFolder, html, getContentType(), UTF_CHARSET, null);

// When TOKEN_TEXT_CONVERTER_MAX_ZOOM_OUT_BY_DEFAULT is contained in text zoom out as far possible
Expand Down

0 comments on commit 06d2c4a

Please sign in to comment.