GithubHelp home page GithubHelp logo

Comments (11)

ivannieto avatar ivannieto commented on May 26, 2024 1

I always do it. The example provided is not written by me, it was just found on the net. 😄 Cool. I'll be waiting for updates. Thanks, and thanks for the great job Zach!

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024 1

Just a note: if there's a section of code that is only inside of a <pre> tag that you really need to be formatted, you can use your dev tools to add the <code> tag surrounding that content before running Just Read. Since it grabs the page at the time when it's ran, Just Read will include the <code> in its version.

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024

Can you please provide an example page where this error occurs?

Are you talking about just plain <code> tags without a <pre> tag surrounding it?

from just-read.

ivannieto avatar ivannieto commented on May 26, 2024

Hmmm I see now, the article has no code tag embedded into the pre content so it should had bypassed it. BTW, text inside a pre tag should be formatted as it is stated. It's not relative to the code tag (if we want to avoid this kind of problems). You could extract the code from this article: http://elmanantialdebits.blogspot.com.es/2013/08/que-es-eso-de-la-programacion-asincrona.html

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024

Thanks for bringing this up. This behavior was purposely implemented. <pre> tags with no <code> inside of them are converted to <p> tags in Just Read's format.

This is done because some sites that I've come across (unfortunately I didn't save the link(s)) put regular types of text content inside of the <pre> tag. Since Just Read is meant to take all formatting away from article type of content, I convert it to a <p> tag so that the browser's styling is removed.

With that being said, if you come across several sites where this is an issue, where the <pre> formatting is actually needed, I'm open to changing the way the <pre>s are handled.


With that being said, there's a small error in how the line breaks of <pre>s are handled on that page - they should have the same number of lines as the <pre> tags, just in <p>s instead. I'll look into what's causing that issue.

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024

Update: The error in handling line breaks inside of <pre>s should be fixed as of b2c7227 / version 1.0.2. Let me know if that is satisfactory for your use case.

from just-read.

ivannieto avatar ivannieto commented on May 26, 2024

Line breaks work well now for the example provided, but it keeps bypassing indenting.

With Just Read ON it shows this now, as you can see:

leer_teclado_asincrono(t => {
leer_fichero_asincrono(f => {
leer_datos_asincrono(d => {
imprime(t,f,d)
})
})
})

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024

For now I will keep the functionality as it was originally designed for the reasons stated above.

If you're writing pages that use code, make sure to use the <code> element!

from just-read.

dflock avatar dflock commented on May 26, 2024

This breaks code blocks in any site that uses MediaWiki - like Wikipedia, etc... See this page for an example: https://en.wikipedia.org/wiki/Web_storage#sessionStorage

The code blocks on Wikipedia are just <pre> tags, not <pre><code>, so they get borked.

Would be nice if there was a setting for this - "Keep <pre> tags" or something.

from just-read.

ZachSaucier avatar ZachSaucier commented on May 26, 2024

I added the ability for users to choose whether or not to reformat <pre> tags in "Additional options" on the Options page as of version 1.0.14.

Thanks for the comment!

from just-read.

dflock avatar dflock commented on May 26, 2024

from just-read.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.