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

Pull Request: Fix “AXT Heading” Typos to “ATX Heading” in Markdown … #2202

Closed
wants to merge 1 commit into from

Conversation

cnemri
Copy link

@cnemri cnemri commented Dec 31, 2024

…Filters

Overview

What’s wrong

In the markdown filtering code for nbconvert, the standard Markdown headings (commonly referred to as “ATX headings”) were mistakenly spelled as “AXT.” This can lead to confusion and errors such as:

AttributeError: 'MathBlockParser' object has no attribute 'parse_axt_heading'

if something tries to call a method by the wrong name.

Why it matters

  • Markdown headings of the form # Heading are typically referred to as ATX headings.
  • Maintaining consistent naming is helpful for contributors and future maintainers; it also aligns with official Mistune 2.x/3.x naming conventions.

Proposed Changes

Rename All Instances of “AXT” to “ATX”

In the MathBlockParser for Mistune ≥ 3.0, rename:

- AXT_HEADING_WITHOUT_LEADING_SPACES
+ ATX_HEADING_WITHOUT_LEADING_SPACES
- "axt_heading": AXT_HEADING_WITHOUT_LEADING_SPACES
+ "atx_heading": ATX_HEADING_WITHOUT_LEADING_SPACES

Also, change any internal references accordingly (for example, if there were a parse_axt_heading method, rename it to parse_atx_heading).


Ensure Backward Compatibility

  • The change is purely a naming fix, so it should not break existing code or templates, as long as the references within nbconvert are updated consistently.
  • If any external plugins or code rely on the old axt_heading name, they might need a minor update, but that’s highly unlikely unless they were already overriding nbconvert’s internal parser.

…Filters

## Overview

### What’s wrong
In the markdown filtering code for **nbconvert**, the standard Markdown headings (commonly referred to as “ATX headings”) were mistakenly spelled as **“AXT.”** This can lead to confusion and errors such as:

```
AttributeError: 'MathBlockParser' object has no attribute 'parse_axt_heading'
```

if something tries to call a method by the wrong name.

### Why it matters

- Markdown headings of the form `# Heading` are typically referred to as **ATX headings**.  
- Maintaining consistent naming is helpful for contributors and future maintainers; it also aligns with official Mistune 2.x/3.x naming conventions.

---

## Proposed Changes

### Rename All Instances of “AXT” to “ATX”

In the `MathBlockParser` for Mistune ≥ 3.0, rename:

```diff
- AXT_HEADING_WITHOUT_LEADING_SPACES
+ ATX_HEADING_WITHOUT_LEADING_SPACES
```

```diff
- "axt_heading": AXT_HEADING_WITHOUT_LEADING_SPACES
+ "atx_heading": ATX_HEADING_WITHOUT_LEADING_SPACES
```

Also, change any internal references accordingly (for example, if there were a `parse_axt_heading` method, rename it to `parse_atx_heading`).

---

### Ensure Backward Compatibility
- The change is purely a naming fix, so it should not break existing code or templates, as long as the references within **nbconvert** are updated consistently.  
- If any external plugins or code rely on the old `axt_heading` name, they might need a minor update, but that’s highly unlikely unless they were already overriding **nbconvert**’s internal parser.
```
@cnemri cnemri marked this pull request as draft December 31, 2024 22:10
@cnemri cnemri marked this pull request as ready for review December 31, 2024 22:11
@krassowski
Copy link
Member

It looks like #2199 approaches this with more backward compatibility.

@krassowski
Copy link
Member

Closing in favour of #2199

@krassowski krassowski closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants