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

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

我在 Win10 上使用 jekyll 4.1.1 建立一个学术网站,分叉自:https://github.com/sbryngelson/sbryngelson.github.io。 我正在阅读一个 .yml 文件,其中列出了出版物的引用。显然,所有项目的格式都相同,但在某些时候,我在 运行 "bundle exec jekyll serve --trace":

之后收到以下错误

在第 111 行第 3 列解析块映射时未找到预期的键(Psych::SyntaxError)

如果我转到我找到的确切行的文件:

- 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."



第 111 行是具有第二个标题的行:即 - 标题:“建模 .... 我也复制并粘贴了上一个项目,仅供参考,因为它被读取时没有错误。 我知道当文件中存在一些额外的字符或文本没有很好地缩进时,就会发生这种错误。在这种情况下,这两种情况都没有得到验证。 这可能是一个微不足道的错误,但我无法想象解决方案。我也尝试在文件中移动上面的 object 但我总是在同一行得到相同的错误。我还想象了所有隐藏的角色,但没有。 有人可以建议我一个解决方案吗?谢谢。

在 YAML 中引用字符串时,基本上有 5 种不同的方式。

在示例的最后一行中,您使用了双引号。 但是双引号不能在双引号本身中使用未转义的,这就是你所拥有的:

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

您必须使用反斜杠对它们进行转义(参见 Double Quoted

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

您收到的错误消息不是很有用。其他 YAML 处理器可能会提供更好的处理器和更正确的错误位置。例如 PyYAML 报告正确的行和位置。