wip
This commit is contained in:
		
							parent
							
								
									99ca3f0fde
								
							
						
					
					
						commit
						8823ae7e85
					
				
					 4 changed files with 11 additions and 6 deletions
				
			
		|  | @ -37,6 +37,7 @@ module.exports = { | |||
| 		'no-useless-escape': ['off'], | ||||
| 		'no-multi-spaces': ['warn'], | ||||
| 		'no-control-regex': ['warn'], | ||||
| 		'no-empty': ['warn'], | ||||
| 		'@typescript-eslint/no-var-requires': ['warn'], | ||||
| 		'@typescript-eslint/no-inferrable-types': ['warn'], | ||||
| 		'@typescript-eslint/no-empty-function': ['off'], | ||||
|  |  | |||
|  | @ -37,11 +37,12 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { | |||
| 		if (!treeAdapter.isElementNode(node)) return; | ||||
| 
 | ||||
| 		switch (node.nodeName) { | ||||
| 			case 'br': | ||||
| 			case 'br': { | ||||
| 				text += '\n'; | ||||
| 				break; | ||||
| 			} | ||||
| 
 | ||||
| 			case 'a': | ||||
| 			case 'a': { | ||||
| 				const txt = getText(node); | ||||
| 				const rel = node.attrs.find(x => x.name === 'rel'); | ||||
| 				const href = node.attrs.find(x => x.name === 'href'); | ||||
|  | @ -87,8 +88,9 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { | |||
| 					text += generateLink(); | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 
 | ||||
| 			case 'p': | ||||
| 			case 'p': { | ||||
| 				text += '\n\n'; | ||||
| 				if (node.childNodes) { | ||||
| 					for (const n of node.childNodes) { | ||||
|  | @ -96,14 +98,16 @@ export function fromHtml(html: string, hashtagNames?: string[]): string { | |||
| 					} | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 
 | ||||
| 			default: | ||||
| 			default: { | ||||
| 				if (node.childNodes) { | ||||
| 					for (const n of node.childNodes) { | ||||
| 						analyze(n); | ||||
| 					} | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -278,7 +278,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us | |||
|  * @param resolver Resolver | ||||
|  * @param hint Hint of Person object (この値が正当なPersonの場合、Remote resolveをせずに更新に利用します) | ||||
|  */ | ||||
| export async function updatePerson(uri: string, resolver?: Resolver | null, hint?: object): Promise<void> { | ||||
| export async function updatePerson(uri: string, resolver?: Resolver | null, hint?: Record<string, unknown>): Promise<void> { | ||||
| 	if (typeof uri !== 'string') throw new Error('uri is not string'); | ||||
| 
 | ||||
| 	// URIがこのサーバーを指しているならスキップ
 | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ | |||
|  * @param last URL of last page (optional) | ||||
|  * @param orderedItems attached objects (optional) | ||||
|  */ | ||||
| export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: object) { | ||||
| export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: Record<string, unknown>) { | ||||
| 	const page: any = { | ||||
| 		id, | ||||
| 		type: 'OrderedCollection', | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue