Comments (6)
I agree. Trying to come up with a more generalized solution would also be more language-independent. The short words to ignore, for example, are all in English right now. However, I would define the "exception rules" a bit differently.
I imagine for some users, the rule titlecase rule also has the side benefit of automatically fixing typos like # FOobar
as well. Stipulating that the titlecase rule should only apply to lowercase words would remove with this welcome side effect.
Here is what I would suggest as sensitive title-case-exception-rules
- all words with 3 or less characters are lowercased (except when at the beginning)
- all words with 4 or more characters that are combinations of two words from 1) are also lowercased (except when at the beginning). This ensures words like "into" stay lowercase for consistency.
- all words that are completely uppercased will stay so to ensure, as it is assumed that they are acronyms.
This leaves some edge cases (e.g. "with") and words with special casing (e.g. "iPhone"). The number of those cases should however be quite small, so it could make sense to keep a list of such words, like the titlecase rule does right now.
from obsidian-linter.
I think English is too complicated to handle all the edge cases. Your logic would skip words like cat, and there are countless other cases.
I found this popular implementation which looks good to me.
Running Linter should never make your document worse, since its run so often.
from obsidian-linter.
You are right, I always forget how many short words English has. However, this leaves the problem how to titlecase correctly in languages other than English. Is there maybe some solution like "change-case" available that also works on most common languages?
from obsidian-linter.
Not afaik. Maybe implementing a way to turn off rules in a file would alleviate this issue. #46
from obsidian-linter.
I also ran into this problem.
I think there are 2 ways to resolve this, the plugin can let the user create a list of word that:
- ignore the heading titleCase
OR - Alway use AllCaps (I would prefer this option, since the plugin can also apply linting while saving)
Cause the people who wrote their note know the acronym they want to use. I think letting the user define their own list can resolve most of the edge case.
from obsidian-linter.
closing because the new option to ignore already cased words should give enough flexibility to users
from obsidian-linter.
Related Issues (20)
- FR: Option to replace "linter-yaml-title-alias" with title key HOT 5
- FR: Option to create blank line between text and images
- FR: Add Rule to Remove Blank Lines After YAML HOT 8
- Bug: No Bare URLs fails if url contains '@' (at)
- Bug: couldn't load plugin on android mobile obsidian HOT 1
- Bug: Blockquote Style removes code block indentation HOT 8
- Bug: Linter Runs Custom Commands even When All Custom Commands Are Blank HOT 5
- FR: Don't change cursor position on lint, and scroll to current line after linting if moved HOT 5
- Bug: Issues with No Bare URLs rule HOT 5
- Some linting rules disrupts header fold states HOT 5
- Question: Possible to Save Current Time When Using Template to Create Note HOT 3
- FR: Add option to skip Liquid tags and content wrapped by them HOT 2
- Bug: forbidden character combinations while copy & pasting the text of a website to a note HOT 4
- FR: Add option to save YAML timestamps in UTC
- FR: Keep Title if It Already Exists HOT 6
- FR: Ignore hyphens in "Space between Chinese Japanese or Korean and English or numbers" HOT 11
- Bug: MisspellingToCorrection not check correctly if my default language in OS settings is English HOT 3
- Bug: `Empty Lines Around Code Fences` can cause problems with nested callouts HOT 1
- FR: Don't auto-complete acronyms
- Bug: Created date gets updated to a different timezone HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian-linter.