code: function format_input_text(input, _parse, _format, operation, on_change)
  {
  	// Parse `<input/>` textual value.
  	// Get `value` and `caret` position.
  	let { value, caret } = parse(input.value, getCaretPosition(input), _parse)
  
  	// If a user performed an operation (e.g. "Backspace", "Delete")
  	// then apply that operation and get new `value` and `caret` position.
  	if (operation)
  	{
  		const operation_applied = edit(value, caret, operation)
  
  		value = operation_applied.value
  		caret = operation_applied.caret
  	}
  
  	// Format the `value`.
  	// (and reposition the caret accordingly)
  	const formatted = format(value, caret, _format)
  
  	const text = formatted.text
  	caret      = formatted.caret
  
  	// Set `<input/>` textual value manually
  	// to prevent React from resetting the caret position
  	// later inside subsequent `render()`.
  	// Doesn't work for custom `inputComponent`s for some reason.
  	input.value = text
  	// Position the caret properly.
  	setCaretPosition(input, caret)
  
  	// `<input/>` textual value may have changed,
  	// so the parsed `value` may have changed too.
  	// The `value` didn't neccessarily change
  	// but it might have.
  	on_change(value)
  }
docs: Parses and re-formats `<input/>` textual value.
  E.g. when a user enters something into the `<input/>`
  that raw input must first be parsed and the re-formatted properly.
  Is called either after some user input (e.g. entered a character, pasted something)
  or after the user performed an `operation` (e.g. "Backspace", "Delete").
  @param  {DOMElement} input
  @param  {Function} parse
  @param  {Function} format
  @param  {string} [operation] - The operation that triggered `<input/>` textual value change. E.g. "Backspace", "Delete".
  @param  {Function} onChange