错误:解析块映射时未找到预期的密钥

时间:2020-10-13 08:23:52

标签: yaml jekyll

我在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行是具有第二个标题的行:即-标题:“建模...。 我也复制并粘贴了上一项,仅供参考,因为读取时没有错误。 我知道,当文件中存在一些额外的字符或文本缩进不充分时,会发生这种错误。在这种情况下,两种情况均未得到验证。 这可能是一个微不足道的错误,但我无法直观地看到解决方案。我也尝试将对象移到文件中的上方,但始终在同一行上遇到相同的错误。我还可视化了所有隐藏的角色,但一无所获。 有人可以建议我解决方案吗?谢谢。

1 个答案:

答案 0 :(得分:2)

在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报告正确的行和位置。