How to get current file content without YAML frontmatter?

Here’s an updated version of the code that works in Obsidian 1.4.0 and onwards, when FrontMatterCache no longer has a position property.

const file = app.workspace.getActiveFile();
let text = editor.getDoc().getValue()
let position = app.metadataCache.getFileCache(file)?.frontmatterPosition;
let end = position.end.line + 1 // accont for ending ---
body = text.split("\n").slice(end).join("\n")