Bhargava 6063bd1724 Help Project:
1. Initial Commit - a boiler plate code and POC to realize the concept of context
sensitive help
2. Frontend code written in ReactJS
3. Backend code written in Java, Spring Boot Framework
4. Frontend Start:
        pre-requisites : node, npm
	npm run dev  ==> to start the frontend vite server
5. Backend Start:
	pre-requisites : java, mvn
        mvn spring-boot:run  ==> to start the backend server
6. Visit http://localhost:5173/ for basic demo of help, press F1 in textboxes
7. Visit http://localhost:5173/editor and enter "admin123" to add/modify texts.

Happy Coding !!!

Thank you,
Bhargava.
2025-07-04 15:54:13 +05:30

40 lines
1.1 KiB
JavaScript

/**
* @import {Join} from 'mdast-util-to-markdown'
*/
import {formatCodeAsIndented} from './util/format-code-as-indented.js'
import {formatHeadingAsSetext} from './util/format-heading-as-setext.js'
/** @type {Array<Join>} */
export const join = [joinDefaults]
/** @type {Join} */
function joinDefaults(left, right, parent, state) {
// Indented code after list or another indented code.
if (
right.type === 'code' &&
formatCodeAsIndented(right, state) &&
(left.type === 'list' ||
(left.type === right.type && formatCodeAsIndented(left, state)))
) {
return false
}
// Join children of a list or an item.
// In which case, `parent` has a `spread` field.
if ('spread' in parent && typeof parent.spread === 'boolean') {
if (
left.type === 'paragraph' &&
// Two paragraphs.
(left.type === right.type ||
right.type === 'definition' ||
// Paragraph followed by a setext heading.
(right.type === 'heading' && formatHeadingAsSetext(right, state)))
) {
return
}
return parent.spread ? 1 : 0
}
}