Giter Site home page Giter Site logo

Comments (5)

jmalarcon avatar jmalarcon commented on August 19, 2024

Hi,

I think you've made a small mistake since this works as expected. The problem, I guess, is that you have added some kind of space before the front-matter. For example, probably an empty line at the beginning of the file.

You must take into account that Front-Matter must be always the first thing in the file. This is by design and it works exactly the same way in any other CMS system such as Jekyll or Hugo. For example, in Jekyll you can't even have the BOM mark in UTF-8 files before the Front-Matter, which I think it's kind of crazy. In MIIS's case, it allows for more than 3 dashes as Front-Matter separator, but it absolutely must be the first thing in the file.

That means: no single space or new line must exists before Front-Matter or it will be considered a part of the content. That's what's happening in your case. Since the last --- are a way to define second level headers, that's why you're getting an <h2> with the FM as content. This works exactly the same in previous versions of MIIS, so it's something extra you've typed in your file since you' ve upgraded MIIS.

Solution: Just remove the extra spaces or new lines at the very top of the file and it'll work 😊

I've been working hard in my spare time on the new v3.0 of MIIS that will have tons of new features and nice new things. I hope to have it finished and polished in the next few weeks.

Cheers!

from miis.

ritti avatar ritti commented on August 19, 2024

Hi,
thanks for the useful hint! I tested a little bit and found out that the jumping point is that the markdown files are in UTF8 with Unix Line ending style and not with Windows/DOS. When I store the file with DOS afterwards everything works as expected.
Question: Is this behavior also expected? I'm not sure if Jekyll or Hugo also expect this?

SampleYamlHeader md _UTF8_WindowsDOS_vs_Unix

Thanks a lot!

By the way: MIISHanlder.dll Version 2.2.0 didn't care about Unix or Windows/DOS.

from miis.

jmalarcon avatar jmalarcon commented on August 19, 2024

Hi,

Ah, ok, interesting... This is why attaching the original file is always a better idea than simply pasting the contents, because even a minor detail like this can influence the result.

In MIIS's case, to detect the Front-Matter I've used a simple regular expression If you check the specific line here you can see I'm using Environment.NewLine to detect the end of the FM. Therefore, it seeks for the current operating system's end of line. In Windows/IIS that means "\r\n". In Linux/UNIX it means "\n" and in Mac it means "\r". A nightmare IMHO. Although MIIS only works under Windows right now.

It could be easily changed so that any of them would be enough. I'll take that into consideration and think about possible problems of doing it.

However, Why are you using UNIX EOL style if you're working under Windows? Just for the sake of curiosity... Maybe you need to work with some co-workers that use Linux?

Cheers.

from miis.

ritti avatar ritti commented on August 19, 2024

Hi,
sorry for the late answer.
Thanks for your clarification. I investigated and had a look where the "\n" end of lines come from.
In my scenario I have XML files that are converted by a open-source tool (DITA-OT) to markdown.
These files result in the UNIX EOL style.
Of course it would be nice if MIIS 2.3 also supports this style.
But I expect that you invest all your time in MIIS 3.0 that hopefully comes soon;-)
Thanks so far!

from miis.

jmalarcon avatar jmalarcon commented on August 19, 2024

Interesting.

Yes, I have v3.0 very advanced, with a huge set of new features and extensibility. I think the bits will be ready very soon, although I have a lot of documentation work to do before releasing the final product.

I've taken into account this problem with new lines in UNIX, and it will disappear in the new version.

You can check the v3 branch for a the new code.

from miis.

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.