GithubHelp home page GithubHelp logo

Comments (6)

irrationalistic avatar irrationalistic commented on September 23, 2024

I think this comes from how classes are dynamically added to the element for syntax highlighting! When you add a title, it gets its own class so that it can be customized in the stylesheet and it seems that having a space isn't accounted for in the transform. This happens here: https://github.com/irrationalistic/atom-tasks/blob/master/lib/tasks.cson#L12
This uses downcase to set everything to lowercase, so i'm trying to see if there's a way to also override spaces so that we don't get this weird behavior.

from atom-tasks.

massic80 avatar massic80 commented on September 23, 2024

Hi @irrationalistic ,
the weird thing is that this occurs only when you write About (upper or lowercase) after the space.
If you write
something(space)somethingelse:
everything works as expected

from atom-tasks.

irrationalistic avatar irrationalistic commented on September 23, 2024

@massic80: it's mostly just a weird coincidence that there is a special style for anything with the "about" class! You can try it with test cursor: or test indent-guide: or any of the classes available in that context. Essentially, to help with custom styling for groupings or headings, the text of the heading is added to the resulting syntax as a class (which you can target in your custom stylesheet). This ends up having conflicts since a space is actually a delimiter in class names, so if you use a single word as header, it ends up something like class="syntax--source syntax--myheader, but if you put a space in the header, it'd end up like class="syntax--source syntax--my header, which is actually three classes!

from atom-tasks.

irrationalistic avatar irrationalistic commented on September 23, 2024

So it looks like the only transforms supported are downcase and upcase in the first-mate library: https://github.com/atom/first-mate/blob/254d43b7a941a7fe63a4ad85a7766108561fec7c/src/pattern.coffee#L3

This means that fixing this particular issue could take a few different paths:

  1. Do nothing and just try to avoid using "about" as the second word
  2. Remove the custom classname functionality from headers
  3. Submit PR to first-mate to add more support for textmate transforms (https://macromates.com/textmate/manual/references#format-string)

I'm inclined to go with 2 on this one, but i'm not sure of the usage of custom styles that might break. I think i just added the functionality when building this, so i don't think it was a requested feature and folks may not even know about it. What are your thoughts?

from atom-tasks.

massic80 avatar massic80 commented on September 23, 2024

Whoops, I didn't notice you asked a question :)
Don't know what's best: is option 2 hard to implement?

from atom-tasks.

massic80 avatar massic80 commented on September 23, 2024

Hi! I also found out that "console" keyword pushed the ":" to a new line

from atom-tasks.

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.