Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update header.ts #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export type HeaderInfo = {
* Template where each field name is prefixed by $ and is padded with _
*/
const genericTemplate = `
********************************************************************************
* *
* ::: :::::::: *
* $FILENAME__________________________________ :+: :+: :+: *
* +:+ +:+ +:+ *
* By: $AUTHOR________________________________ +#+ +:+ +#+ *
* +#+#+#+#+#+ +#+ *
* Created: $CREATEDAT_________ by $CREATEDBY_ #+# #+# *
* Updated: $UPDATEDAT_________ by $UPDATEDBY_ ### ########.fr *
* *
********************************************************************************
*************************************************************************************
* *
* ::: :::::::: *
* $FILENAME_______________________________________ :+: :+: :+: *
* +:+ +:+ +:+ *
* By: $AUTHOR_____________________________________ +#+ +:+ +#+ *
* +#+#+#+#+#+ +#+ *
* Created: $CREATEDAT_________ by $CREATEDBY______ #+# #+# *
* Updated: $UPDATEDAT_________ by $UPDATEDBY______ ### ########.fr *
* *
*************************************************************************************

`.substring(1)

Expand Down Expand Up @@ -79,7 +79,7 @@ export const supportsLanguage = (languageId: string) =>
* Returns current header text if present at top of document
*/
export const extractHeader = (text: string): string | null => {
const headerRegex = `^(.{80}(\r\n|\n)){10}`
const headerRegex = `^(.{85}(\r\n|\n)){10}`
const match = text.match(headerRegex)

return match ? match[0].split('\r\n').join('\n') : null
Expand Down