Managed to get centered section headings in Mac text editor.
Items examples grammar in text.
Oops, endsWith is not standard Javascript at all. Using regexp.