Search code examples
yamljekyll

Error : did not find expected key while parsing a block mapping


I use jekyll 4.1.1 on Win10 to build an academic website forked from: https://github.com/sbryngelson/sbryngelson.github.io . I am reading a .yml file where references of publications are listed. Apparently, all the items are equally formatted, but at some point, I get the following error after running "bundle exec jekyll serve --trace":

did not find expected key while parsing a block mapping at line 111 column 3 (Psych::SyntaxError)

If I go to the file at the exact line I found:

- title: "Integrated multiplatform method for in vitro quantitative assessment of cellular uptake for fluorescent polymer nanoparticles"
  authors: "R.Ferrari, M.Lupi, F.Falcetta, P.Bigini, K.Paolella, F.Fiordaliso, C.Bisighini, M.Salmona, M.D'Incalci, M.Morbidelli, D.Moscatelli, P.Ubezio"
  url: 
  image: 
  journal: "Nanotechnology"
  info: "24398665"
  year: "2014"
  doi: "10.1088/0957-4484/25/4/045102"
  abstract: "Studies of cellular internalization of nanoparticles (NPs) play a paramount role for the design of efficient drug delivery systems, but so far they lack a robust experimental technique able to quantify the NP uptake in terms of number of NPs internalized in each cell. In this work we propose a novel method which provides a quantitative evaluation of fluorescent NP uptake by combining flow cytometry and plate fluorimetry with measurements of number of cells. Single cell fluorescence signals measured by flow cytometry were associated with the number of internalized NPs, exploiting the observed linearity between average flow cytometric fluorescence and overall plate fluorimeter measures, and previous calibration of the microplate reader with serial dilutions of NPs. This precise calibration has been made possible by using biocompatible fluorescent NPs in the range of 20-300 nm with a narrow particle size distribution, functionalized with a covalently bonded dye, Rhodamine B, and synthesized via emulsion free-radical polymerization. We report the absolute number of NPs internalized in mouse mammary tumor cells (4T1) as a function of time for different NP dimensions and surface charges and at several exposure concentrations. The obtained results indicate that 4T1 cells incorporated 103-104 polymer NPs in a short time, reaching an intracellular concentration 15 times higher than the external one. © 2014 IOP Publishing Ltd."

- title: "Modeling of large-scale horizontal reactor for silicon epitaxy"
  authors: "A.Veneroni, D.Moscatelli, M.Masi"
  url: 
  image: 
  journal: "Journal of Crystal Growth"
  info: ""
  year: "2005"
  doi: "10.1016/j.jcrysgro.2004.10.108"
  abstract: "A detailed 3D simulation of a large-scale industrial cold-wall horizontal reactor for epitaxial silicon deposition is presented. Simulations showed that realistic inlet jets description is necessary to obtain a reliable picture of the system. Different chamber geometries are analyzed with the aim of reducing the "memory effects" during the dopant switching in junction production inside the same reactor chamber without wafers loading and unloading. Configurations inducing a graded gas expansion have been identified as contributing to the solution of the problem. © 2004 Elsevier B.V. All rights reserved."



The line 111 is the line with the second title: i.e. - title: "Modeling .... I copied and pasted also the previous item just for reference since it is read without error. I understood that this kind of error happens when some extra characters are present in the file or the text is not well indented. Both cases are not verified in this situation. It could be a trivial mistake, but I cannot visualize the solution. I have also tried to move the object above in the file but always I get the same error on the same line. I have also visualized all the hidden characters, but nothing. Someone can suggest me a solution ? thanks.


Solution

  • When quoting strings in YAML, you have basically 5 different ways.

    In the last line of your example you are using double quotes. But double quotes cannot be used unescaped in double quotes itself, and this is what you have there:

    abstract: "A detailed 3D simulation of a large-scale... "memory effects" ..."
    

    You have to escape them with a backslash (see Double Quoted)

    abstract: "A detailed 3D simulation of a large-scale... \"memory effects\" ..."
    

    The error message you get is not very helpful. Other YAML processors might provide better ones and a more correct location of the error. For example PyYAML reports the correct line and location.