JSFiddle - React, Tailwind, and code Playground
by Jay
HTML
<textarea>
---
title: This is a great title
date: 2012-03-02 11:30:00 -04:00
published: false
layout: kool
---
data_one
data_two
data_three
</textarea>
<h1></h1>
JavaScript
let text = document.querySelector('textarea').value;
let tex = document.querySelector('h1')
data = text
.match(/---[\s\S]*---/)[0]
//.match(/layout:\s?\s?\w*/)[0].replace(/layout:/,"")
// .split(/\s+/)
//filter(str => str.length);
tex.innerHTML=data[0];