Coder Social home page Coder Social logo

Comments (11)

delashum avatar delashum commented on August 16, 2024

Can you screenshot me the error the console is throwing?

from obsidian-checklist-plugin.

brimwats1 avatar brimwats1 commented on August 16, 2024

image

from obsidian-checklist-plugin.

matpatterson avatar matpatterson commented on August 16, 2024

I am seeing this same issue
Screen Shot 2021-03-31 at 8 23 28 am

from obsidian-checklist-plugin.

delashum avatar delashum commented on August 16, 2024

Okay yeah this is the same issue as #33. The problem is that there are multiple ways to format a YAML list:

# A
tags: [one, two]
# B
tags: one, two
# C
tags: 
  - one
  - two

and I only support A. So either this plugin needs to support all of these formats, or you can change your YAML to use A.

I am curious, how do you have your tags formatted?

from obsidian-checklist-plugin.

brimwats1 avatar brimwats1 commented on August 16, 2024

Ah that means that it would be incompatible with the latest changes in the mdnotes extension changes which does YAML like C
https://forum.obsidian.md/t/zotero-zotfile-mdnotes-obsidian-dataview-workflow/15536

I hadn't used YAML or formatted my tags until this week, I wanted to use checklist with mdnotes in order to auto extract certain highlights as checklists that I could come back to

from obsidian-checklist-plugin.

delashum avatar delashum commented on August 16, 2024

Yeah, and they are adding the hash before it as well, which not all do. This is a tricky problem since everyone seems to format their YAML a bit differently. I will just add support for all these then

from obsidian-checklist-plugin.

chetachiezikeuzor avatar chetachiezikeuzor commented on August 16, 2024

I'm also having the same issue. I used the plugin before and it worked fine. My format has always been the same.

Screen Shot 2021-04-03 at 3 01 27 PM

Screen Shot 2021-04-03 at 3 30 09 PM

from obsidian-checklist-plugin.

pjeby avatar pjeby commented on August 16, 2024

Perhaps the plugin should use the parseFrontMatterTags() API?

import {parseFrontMatterTags} from "obsidian"

// ...

const getFrontmatterTags = (cache: CachedMetadata, todoTag?: string) => {
    const frontMatterTags: string[] = parseFrontMatterTags(cache?.frontmatter) ?? [];
    // ...
}

This will handle tags that are formatted as "x, y, z" or "x" as well as the correct "[x, y, z]". It also handles fields named Tags, tAg or any case/plurality variant thereof, making your parsing compatible with how Obsidian does it. The returned tag list also has the # added, if it was omitted from the frontmatter... but doesn't double them up if they were already there.

from obsidian-checklist-plugin.

delashum avatar delashum commented on August 16, 2024

Well I'll be damned, I had no idea that was part of the API. That's definitely the way to do it. Do you know if supports method C that i described above?

from obsidian-checklist-plugin.

pjeby avatar pjeby commented on August 16, 2024

Your case C is the same as case A, in the sense that it is a YAML list value. Case B is a string value that contains commas. The API handles both lists and comma-delimited strings, so yes.

The type declarations for front matter parsing functions can be found here: https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts#L1894

from obsidian-checklist-plugin.

delashum avatar delashum commented on August 16, 2024

fixed in 1.2.0

from obsidian-checklist-plugin.

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.