LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-12-2019, 05:25 AM   #16
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,646
Blog Entries: 9

Rep: Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096

rblampain, you have discovered that different engines (browser, calibre, doesn't matter) render HTML differently.
This is a problem almost as old as HTML itself.
It seems to me that your statement (thread title) is really a hidden question.
It seems you hope that by repeating this question the engines will somehow stop behaving that way.
They won't.
Congratulations on your discovery; but there's no ultimate solution to this.
You can research and hopefully minimize the problem, that's all.
 
2 members found this post helpful.
Old 06-12-2019, 05:47 AM   #17
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,146

Original Poster
Rep: Reputation: 51
Thanks for the clarification, it solves the problem.

My apologies.
Although the sample code gives the same result in Calibre, it does not work in the browser either (Firefox) while the HTML page it is extracted from does work (in the browser) and so far, I cannot see why.

I will follow ondoho's advice.

Somehow, I have raised the curiosity of the creator of Calibre himself and if I receive any advice from him, I will pass it here.

Last edited by rblampain; 06-12-2019 at 05:57 AM.
 
Old 06-12-2019, 11:15 AM   #18
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,859

Rep: Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789Reputation: 3789
Quote:
Originally Posted by rblampain View Post
I recollect reading on the Internet that it does although how is nowhere to be found
Consider that Calibre's source code includes this file...

https://github.com/kovidgoyal/calibr...rver/reset.css

Last edited by dugan; 06-12-2019 at 11:17 AM.
 
1 members found this post helpful.
Old 06-15-2019, 02:35 AM   #19
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,146

Original Poster
Rep: Reputation: 51
From the very clear answer from the creator of calibre:

"..most readers use the browser for the actual rendering.. "
"..calibre work in "paged" mode by default.."
which displays the page containing the targeted link - anywhere in the page.


The solution was to insert a page break before and after so only the targeted link is in that page and displayed after clicking the link.

Added css code in the external CSS file for the targeted links:
Code:
.who_is  {
page-break-before: always;
page-break-inside: avoid;
page-break-after: always;
background-color: silver;
}
It may be that, except first converting files in pages, there may not be that much differences between browsers and Ebook readers although some tags may behave differently in one than in the other.

Last edited by rblampain; 06-15-2019 at 02:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Calibre 3.26.1 EBook Manager Fix PDF files Conversions and Brings Faster loading of HTML files LXer Syndicated Linux News 0 06-16-2018 05:44 AM
LXer: Search and Read Books from Calibre's Library in Ubuntu 13.10 with Unity Calibre Scope LXer Syndicated Linux News 0 11-22-2013 08:12 PM
[SOLVED] Python 2.6 code behaves differently inside function than outside it dracuss Programming 2 03-21-2011 12:51 PM
[SOLVED] rsync works differently under tcsh than bash? Vanyel Linux - Software 2 09-01-2009 09:55 AM
Firefox rendering differently on Linux and Windows nkoplm General 3 03-15-2008 12:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration