【发布时间】:2017-05-17 05:01:29
【问题描述】:
我正在使用 OneNote 的 GET pages REST API 获取 OneNote 页面的 HTML。这是虚拟代码 -
<html lang="nl-NL"> <head>
<title>Sales meeting III</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="created" content="2017-03-14T17:30:00.0000000" />
</head>
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div id="div:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{50}" style="position:absolute;left:48px;top:115px;width:625px">
<p id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{34}" style="font-size:17pt;margin-top:0pt;margin-bottom:0pt">Sales Meeting</p>
<p id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{36}" style="font-size:10pt;color:gray;margin-top:0pt;margin-bottom:0pt">donderdag 9 maart 2017</p>
<p id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{38}" style="font-size:10pt;color:gray;margin-top:0pt;margin-bottom:0pt">20:00</p>
<p id="p:{d6174a59-03a8-4010-9ad9-e5a2e6f57bb3}{28}" lang="en-US" data-tag="to-do" data-id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{40}" style="margin-top:0pt;margin-bottom:0pt">Send draft press release to marketing team</p><br/><br/>
<p id="p:{d6174a59-03a8-4010-9ad9-e5a2e6f57bb3}{33}" lang="en-US" data-tag="to-do" data-id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{43}" style="margin-top:0pt;margin-bottom:0pt">Schedule briefing</p><br/><br/>
<p id="p:{d6174a59-03a8-4010-9ad9-e5a2e6f57bb3}{38}" lang="en-US" data-tag="to-do" data-id="p:{e5d84e97-3676-4df2-9bc6-b9583ebae493}{45}" style="margin-top:0pt;margin-bottom:0pt">Jack is the greatest</p>
<p id="p:{b1177410-4d6e-4ef7-b82c-32695a02218b}{13}" lang="en-US" style="margin-top:0pt;margin-bottom:0pt"></p> <br/><br/>
<br/><br/>
<p id="p:{b1177410-4d6e-4ef7-b82c-32695a02218b}{13}" lang="en-US" style="margin-top:0pt;margin-bottom:0pt">This is Testing</p> <br/><br/>
</div> </body> </html>
现在,我通过 PATCH API 中的“替换”方法使用其唯一 ID 仅更新“p”(段落)标签。据我所知,此操作与页面的其余 HTML 完全无关。内容正在正确更新,我从 API 获得了成功的响应,但它也在删除 br 标签。这会扰乱页面的缩进。
如何保持页面的缩进或如何避免删除页面的br标签或换行符,我希望它们在页面上保持原样。
提前致谢。
【问题讨论】:
标签: onenote onenote-api