Giter Site home page Giter Site logo

Comments (5)

victory-sokolov avatar victory-sokolov commented on June 20, 2024 1

@ndaidong Awesome thanks a lot! Now code blocks are formatted properly.
Thanks once again!

from article-extractor.

ndaidong avatar ndaidong commented on June 20, 2024 1

@victory-sokolov nice to see it works for you.

from article-extractor.

ndaidong avatar ndaidong commented on June 20, 2024

@victory-sokolov thank you for your idea. Could you explain more detail and suggest some links to test? I consider that if that is a specific case, we can simply use transformation.

from article-extractor.

victory-sokolov avatar victory-sokolov commented on June 20, 2024

Not sure if it will be straightforward to implement it using custom transformation.

Here is an example of the extracted code block

import { useTheme } from 'next-themes';   const ThemeChanger = () => {  const { theme, setTheme } = useTheme();    return (  <div>  The current theme is: {theme}  <button onClick={() => setTheme('light')}>Light Mode</button>  <button onClick={() => setTheme('dark')}>Dark Mode</button>  </div>  ); };

and this is the original code copied from the dev console (site)

import { useTheme } from 'next-themes';
 
const ThemeChanger = () => {
  const { theme, setTheme } = useTheme();
 
  return (
    <div>
      The current theme is: {theme}
      <button onClick={() => setTheme('light')}>Light Mode</button>
      <button onClick={() => setTheme('dark')}>Dark Mode</button>
    </div>
  );
};

In general code, blocks have 4 spaces for nested blocks, but when an article is being scrapped it has only one, I guess this is because of the stripMultispaces. Maybe you have other ideas how those spaces can be preserved

Thanks in advance.

from article-extractor.

ndaidong avatar ndaidong commented on June 20, 2024

@victory-sokolov yeah, you are right. It's because of stripMultispaces. Let me see how we can make it as a configurable option.

from article-extractor.

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.